apl/APL1.2/2.Structures/source/Date.c

17 lines
393 B
C
Raw Normal View History

2022-01-14 06:54:18 +01:00
#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;
}