Created
June 23, 2014 09:36
-
-
Save ncopa/68c6fd8471a5a2de706d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1:~/1# cat a.c | |
/* localtime example */ | |
#include <stdio.h> /* puts, printf */ | |
#include <time.h> /* time_t, struct tm, time, localtime */ | |
int main () | |
{ | |
time_t rawtime; | |
struct tm * timeinfo; | |
time (&rawtime); | |
timeinfo = localtime (&rawtime); | |
printf ("Current local time and date: %s", asctime(timeinfo)); | |
return 0; | |
} | |
a1:~/1# ./a.out | |
Current local time and date: Mon Jun 23 11:36:34 2014 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment