Testing localtime functionality.
More...
#include "localtime.c"
#include <sys/time.h>
#include <stdio.h>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Testing localtime functionality.
Definition in file stdtime/test.c.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 8 of file stdtime/test.c.
8 {
9 struct timeval tv;
10 struct tm tm;
11 char *zone[4] = { "America/New_York", "America/Chicago", "America/Denver", "America/Los_Angeles" };
12 int i;
13
14 gettimeofday(&tv,
NULL);
15
16 for (i=0;i<4;i++) {
18 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);
19 }
20 return 0;
21}
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
References ast_localtime(), and NULL.