diff options
author | Mark Spencer <markster@digium.com> | 2003-09-13 20:51:48 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-09-13 20:51:48 +0000 |
commit | 56f915e783e003d027f0ee4674299080e4d893c8 (patch) | |
tree | 0e8008c721582afe7e8954a6be00bdba448be121 /stdtime/test.c | |
parent | c511b967eda76b558d96754f71f3755e49d39498 (diff) |
CLeanup PBX patch and add localtime stuff for saytime (bug #168)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'stdtime/test.c')
-rwxr-xr-x | stdtime/test.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/stdtime/test.c b/stdtime/test.c new file mode 100755 index 000000000..70e2a0c65 --- /dev/null +++ b/stdtime/test.c @@ -0,0 +1,20 @@ +/* Testing localtime functionality */ + +#include "localtime.c" +#include <sys/time.h> +#include <stdio.h> + +int main(int argc, char **argv) { + 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; +} |