Is there some reason that localtime takes a pointer to time_t instead of just time_t? I can't see that the time_t ever gets modified and the time function returns a time_t not a pointer, so you can't make a call like localtime(time(NULL),&tmStruct).

Just curious...