#!/usr/bin/perl use DateTime::Format::Strptime; my $parser = new DateTime::Format::Strptime(pattern => '%d-%b-%Y %H:%M %Z', on_error => 'croak'); my $dt = $parser->parse_datetime("30-Oct-2005 01:04 America/Los_Angeles"); __END__
$ perl test.pl I don't recognise the timezone America. at test.pl line 6 Seems to be a problem specifically with Strptime because your example worked for me. I guess Strptime doesn't know about the same TZs as DateTime. On Fri, 4 Nov 2005 14:09:14 -0800, Hill, Ronald wrote > Hi Jason, > > Jason Bodnar wrote: > > DateTime complains that PST is ambiguous so I tried replacing PST with > > 'US/Pacific', 'America/Los_Angeles' and 'PST8PDT' but DateTime says > > it doesn't recognise [sic] any of those. So what timezone label will > > DateTime accept for Pacific Standard Time? > > Odd, America/Los_Angeles should work. > > use strict; > use warnings; > use DateTime; > > my $dt = DateTime->now( time_zone => 'America/Los_Angeles'); > > print $dt; > > prints 2005-11-04T14:04:52 > > You may want to include a small test script > which demonstrates the error. > > Hope this helps > > Ron Hill -- Jason Bodnar [EMAIL PROTECTED] http://www.shakabuku.org UnWired Buyer. The best way to win on eBay. Period. http://www.unwiredbuyer.com