DEV_BUT1/DEV1.1S/TP02/date.c
2023-02-08 11:18:16 +01:00

15 lines
289 B
C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void){
time_t temps= time(NULL);
struct tm* date = localtime(&temps);
printf("%d", date->tm_year+1900);
printf("-");
printf("%d", date->tm_mon+1);
printf("-");
printf("%d\n", date->tm_mday);
return EXIT_SUCCESS;
}