Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 120906
Status: open
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors: abraxxa [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.49
Fixed in: (no value)



Subject: timezone incorrect after daylight saving time switch
Using this timestamp field pattern %d{yyyy-MM-ddTHH:mm:ss.SSSZ} the timezone information is still +0100 instead of +0200 after the daylight saving time switch. From reading the code I saw that the localtime perl function is used by default and there seems to be no way to specify that UTC should be returned in which case the literal 'Z' could be used to indicate that it's UTC. On restart of the app the timezone information is correct. This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux
Am Mo 03. Apr 2017, 11:43:57, ABRAXXA schrieb: Show quoted text
> From reading the code I saw that the localtime perl function is used > by default and there seems to be no way to specify that UTC should be > returned in which case the literal 'Z' could be used to indicate that > it's UTC.
I have to revert this statement. 'gmtime' can be used instead of localtime if the global module variable $GMTIME is set to a true value but this isn't documented and would also cause action at distance if one module enables the variable whereas another expects localtime to be used.
On 2017-04-03 08:43:57, ABRAXXA wrote: Show quoted text
> Using this timestamp field pattern %d{yyyy-MM-ddTHH:mm:ss.SSSZ} the > timezone information is still +0100 instead of +0200 after the > daylight saving time switch.
I ran into this yesterday (when switching from daylight savings back to standard time), in the 'America/Los_Angeles' timezone. The offset is calculated only once, at startup, in Log::Log4perl::DateFormat::rep, by calculating gmtime - localtime. Even though this offset can change during runtime, the cached value is always used. I would suggest perhaps switching to using POSIX::strftime to do the formatting, which uses the system's (fast) routines, rather than trying to optimize in custom perl code.