Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int main()
- {
- time_t now;
- int h, m, s, d, mon, an;
- time(&now);
- printf("il est %s\n", ctime(&now));
- struct tm *local = localtime(&now);
- h = local->tm_hour;
- m = local->tm_min;
- s = local->tm_sec;
- d = local->tm_mday;
- mon = local->tm_mon + 1;
- an = local->tm_year + 1900;
- printf("Heure actuelle : %02d:%02d:%02d\n", h,m,s);
- printf("Date courante : %02d/%02d/%d\n", d, mon, an);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement