Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime-Format-Strptime CPAN distribution.

Report information
The Basics
Id: 23313
Status: resolved
Priority: 0/
Queue: DateTime-Format-Strptime

People
Owner: rickm [...] cpan.org
Requestors: develop [...] traveljury.com
Cc:
AdminCc:

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



Subject: Bug handling time zones like America/New_York
If you do this: use DateTime::Format::Strptime; my $dt=new DateTime::Format::Strptime (pattern => '%O'); print $dt->parse_datetime('America/Chicago'); ---> works correctly print $dt->parse_datetime('America/New_York'); ---> prints: The timezone 'America/New_york' could not be loaded, or is an invalid name. The bug lies with a regular expression which is missing a /g at the end. Patch: --- Strptime.pm 2005-11-29 15:52:51.000000000 +0100 +++ Strptime.pm 2005-11-29 15:47:06.000000000 +0100 @@ -330,7 +330,7 @@ if ($tz_olson) { $tz_olson = ucfirst lc $tz_olson; - $tz_olson =~ s|([/_])(\w)|$1\U$2|; + $tz_olson =~ s|([/_])(\w)|$1\U$2|g; my $tz = DateTime::TimeZone->new( name => $tz_olson ); $self->local_croak("I don't recognise the time zone '$tz_olson'.") \ and return undef unless $tz; $use_timezone = $set_time_zone = $tz;
Resolved in 1.0900. Thanks for taking the time to locate the exact problem and providing a patch. In future, please log bugs in the google-code project: http://code.google.com/p/datetime-format-strptime/
Actually, the solution in #23768 is a better idea: don't mess with the user's input. Though I'm extending it to "unless it didn't work".
Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.