Testing localtime functionality. More...
Go to the source code of this file.
Functions | |
int | main (int argc, char **argv) |
Testing localtime functionality.
Definition in file stdtime/test.c.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 8 of file stdtime/test.c.
References ast_localtime().
{ struct timeval tv; struct tm tm; char *zone[4] = { "America/New_York", "America/Chicago", "America/Denver", "America/Los_Angeles" }; int i; gettimeofday(&tv,NULL); for (i=0;i<4;i++) { ast_localtime(&tv.tv_sec,&tm,zone[i]); printf("Localtime at %s is %04d/%02d/%02d %02d:%02d:%02d\n",zone[i],tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); } return 0; }