13 lines
406 B
C
13 lines
406 B
C
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
#include <time.h>
|
||
|
|
||
|
int main(int argc, char** argv) {
|
||
|
time_t times = time(NULL);
|
||
|
struct tm * timeI = localtime(×);
|
||
|
printf("Heure locale : %02d:%02d:%02d", timeI->tm_hour, timeI->tm_min, timeI->tm_sec);
|
||
|
printf("\n");
|
||
|
printf("Date locale : %04d/%02d/%02d",timeI->tm_year+1900,timeI->tm_mon,timeI->tm_mday);
|
||
|
printf("\n");
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|