Developpement/23DEV1.1/TPS1/TP2/19-Structures/date.c

13 lines
406 B
C
Raw Normal View History

2024-12-09 11:53:11 +01:00
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main(int argc, char** argv) {
time_t times = time(NULL);
struct tm * timeI = localtime(&times);
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;
}