Nov. 1, 2017
8:12 p.m.
Arati Sethy wrote:
u_int64_t time = sysMilliTime(); struct tm *evTime; evTime = localtime(&time);
Here's your problem. localtime() operates on a time_t, the value of which you need to get from time() or from the .tv_sec part of what you get from gettimeofday(). Instead you've taken a correct .tv_sec and multiplied it by 1000. Instead of asking about November 2017 you've asked about October 49804. A zero offset is still not what the tzdb projects for 49804, but localtime() can be forgiven for giving up. -zefram