#16 Timezone::utcOffset has wrong sign

Platform_Specific
closed
nobody
5
2012-09-14
2006-08-06
Caleb Epstein
No

I noticed this bug when using the PatternFormatter with
the property "times=local". It was writing timestamps
later than GMT, even though I am in the US/Eastern
timezone, which has a negative offset from GMT.

The cuprit appears to be Timezone::utcOffset returning
a positive value on my platform (Linux). The ifdef'd
code for APPLE and FreeBSD works correctly, but
on platforms with the "timezone" global variable, like
Linux, the sign on this needs to be reversed.

For example, I get something like this using the defaults:

Sun 13:53:11.298 [D] Application: Initializing
subsystem: Parser
Sun 13:53:11.299 [I] Application: Starting up

But when changing to times=local, I see:

Sun 17:56:40.470 [D] Application: Initializing
subsystem: Parser
Sun 17:56:40.471 [I] Application: Starting up

These timestamps should be 09:56, not 17:56.

Discussion

  • Logged In: YES
    user_id=1148207

    fixed in 1.2
    See also patch #1535774