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

Owner: rickm [...]
Requestors: develop [...]

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

Subject: Bug handling time zones like America/New_York
Download (untitled) / with headers
text/plain 928b
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: --- 2005-11-29 15:52:51.000000000 +0100 +++ 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;
Download (untitled) / with headers
text/plain 205b
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:
Download (untitled) / with headers
text/plain 136b
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".
Download (untitled) / with headers
text/plain 105b
Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to