17 lines
393 B
C
17 lines
393 B
C
|
#include<stdio.h>
|
||
|
#include<stdlib.h>
|
||
|
#include<time.h>
|
||
|
|
||
|
int main(int argc, char * argv[]){
|
||
|
|
||
|
|
||
|
time_t seconds = time(NULL);
|
||
|
struct tm * timeinfo = localtime(&seconds);
|
||
|
printf("%04d-%02d-%02d %02d:%02d:%02d\n",1900+timeinfo->tm_year,timeinfo->tm_mon+1,timeinfo->tm_mday,timeinfo->tm_hour,timeinfo->tm_min,timeinfo->tm_sec);
|
||
|
return 0;
|
||
|
|
||
|
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|
||
|
|