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: 23768
Status: resolved
Priority: 0/
Queue: DateTime-Format-Strptime

People
Owner: Nobody in particular
Requestors: sphink [...] gmail.com
Cc:
AdminCc:

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



Subject: Olson timezone handling incorrect
Date: Mon, 4 Dec 2006 13:11:38 -0800
To: bug-datetime-format-strptime [...] rt.cpan.org
From: "Steve Fink" <sphink [...] gmail.com>
The date string "2006-11-14-11:22:43America/Los_Angeles" cannot be parsed with the format '%Y-%m-%d-%H:%M:%S%O' because of the following code in DateTime::Format::Strptime: $tz_olson = ucfirst lc $tz_olson; $tz_olson =~ s|([/_])(\w)|$1\U$2|; This produces $tz_olson = "America/Los_angeles", which is not a valid timezone. I believe the correct code would be: $tz_olson = ucfirst lc $tz_olson; $tz_olson =~ s|([/_])(\w)|$1\U$2|g; although it seems to me that you could replace all of that with: $tz_olson =~ s/(\w+)/\u$1/g; Not that any of these would work for Mexico/BajaNorte or Antarctica/DumontDUrville. Perhaps it would be better not to mess with the capitalization, or at least look up both the original and normalized versions.
Duplicate of #23313, though I like the solution of just going with the user input better. If that fails, then I attempt to normalize. Resolved in 1.0900. In future, please log bugs in the google-code project: http://code.google.com/p/datetime-format-strptime/