On Wed, Mar 29, 2017 at 10:12:25PM +1300, Peter Lambrechtsen wrote:
encode: - if (localtime_r(&date, &tminfo) == NULL) { - REDEBUG("Failed converting time string to localtime"); - goto error; + if (inst->utc) { + if (gmtime_r(&date, &tminfo) == NULL) { + REDEBUG("Failed converting time string to localtime");
typo: localtime -> UTC
+ goto error; + } + } else { + if (localtime_r(&date, &tminfo) == NULL) { + REDEBUG("Failed converting time string to localtime"); + goto error; + } } return strftime(out, outlen, inst->fmt, &tminfo); ...
Thoughts / comments??
Seems like a good idea to me. UTC/Localtime is always a pain, so as flexible as possible makes sense. Matthew -- Matthew Newton, Ph.D. <mcn4@leicester.ac.uk> Systems Specialist, Infrastructure Services, I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom For IT help contact helpdesk extn. 2253, <ithelp@le.ac.uk>