The timezone value may be negtive. For example, in China, tz.tz_minuteswest * 60UL is -28800.

Comment From: madolson

I think this is only used in the server logging functionality, we haven't observed any weird behavior that I'm aware of.

Comment From: oranagra

@cade-kd you're right, it should be signed. the fact is that this return value is then stored into a time_t variable, which is later passed to another function as time_t, which does some arithmetic, so in practice it's converted back to signed before use (no bugs). p.s. none of these operations (assignment into 32bit integer, and integer subtraction) work any differently if the MSB is set or not.

anyway, no bugs, is not a reason not to fix it. do you wanna issue a PR for that? (i suppose the return value can be either int or time_t)

p.s. the Linux global variable seem to be defined as long, so maybe we should cast it to time_t or keep this function returning a signed long.