• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 #include "cs_config.h"
3 
4 #include <unistd.h>
5 #include <stdlib.h>
6 #include <string.h>
7 
8 #include "util/neo_misc.h"
9 #include "util/neo_err.h"
10 #include "util/neo_date.h"
11 
main(int argc,char * argv[])12 int main(int argc, char *argv[])
13 {
14   time_t t;
15   struct tm ttm;
16   char buf[256];
17 
18   fprintf(stderr, "Starting...\n");
19   fprintf(stderr, "TZ is %s\n", getenv("TZ"));
20   fprintf(stderr, "TZ Offset is %ld\n", timezone);
21 
22   memset(&ttm, 0, sizeof(struct tm));
23   t = 996887354;
24   fprintf(stderr, "US/Eastern Test\n");
25   neo_time_expand(t, "US/Eastern", &ttm);
26 
27   fprintf(stderr, "TZ is %s\n", getenv("TZ"));
28   fprintf(stderr, "TZ Offset is %ld\n", timezone);
29   fprintf(stderr, "TZ Offset is %ld\n", neo_tz_offset(&ttm));
30   fprintf(stderr, "From tm: %s %ld\n", ttm.tm_zone, ttm.tm_gmtoff);
31   strftime(buf, sizeof(buf), "%Y/%m/%d %H:%M:%S", &ttm);
32   fprintf(stderr, "Time is %s\n", buf);
33 
34   fprintf(stderr, "GMT Test\n");
35   neo_time_expand(t, "GMT", &ttm);
36 
37   fprintf(stderr, "TZ is %s\n", getenv("TZ"));
38   fprintf(stderr, "TZ Offset is %ld\n", timezone);
39   fprintf(stderr, "TZ Offset is %ld\n", neo_tz_offset(&ttm));
40   fprintf(stderr, "From tm: %s %ld\n", ttm.tm_zone, ttm.tm_gmtoff);
41   strftime(buf, sizeof(buf), "%Y/%m/%d %H:%M:%S", &ttm);
42   fprintf(stderr, "Time is %s\n", buf);
43 
44   return 0;
45 }
46