Skip Menu |

This queue is for tickets about the Time-Piece CPAN distribution.

Report information
The Basics
Id: 33281
Status: resolved
Priority: 0/
Queue: Time-Piece

People
Owner: Nobody in particular
Requestors: jozef [...] kutej.net
Cc:
AdminCc:

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



Subject: timezones ignoring in strptime
use Time::Piece; my @time_with_format = ( '2008-02-15 10:42:52 +0100', '%Y-%m-%d %H:%M:%S %z', ); print join ',', @time_with_format, "\n"; my $time = Time::Piece->strptime(@time_with_format); print $time->strftime, ', tzoffset ',$time->tzoffset, "\n"; i get this output: 2008-02-15 10:42:52 +0100,%Y-%m-%d %H:%M:%S %z, Fri, 15 Feb 2008 10:42:52 UTC, tzoffset 0 It was expecting 09:42:52 UTC. Or am I doing something wrong?
Not doing anything wrong, just most internal implementations of strptime (including the one which is added into Time::Piece if it can't find a system one) don't support %z. The one on the mac certainly doesn't. Sad really, as it's not that hard to implement. I'm putting one into the provided strptime, but it depends what platform you're on - that might never get picked up. (marking as resolved)