Skip to content

Commit

Permalink
Add UTC to list of valid time zones
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Oct 16, 2010
1 parent 4f89e0d commit 592cc5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/DateTime/Format/Strptime.pm
Expand Up @@ -120,6 +120,7 @@ use vars
'Y' => '-1200', 'YAKST' => '+1000', 'YAKT' => '+0900',
'YAPT' => '+1000', 'YDT' => '-0800', 'YEKST' => '+0600',
'YEKT' => '+0500', 'YST' => '-0900', 'Z' => '+0000',
'UTC' => '+0000',
);

sub new {
Expand Down
11 changes: 10 additions & 1 deletion t/008_epoch.t
Expand Up @@ -2,7 +2,7 @@

# t/008_epoch.t - Epoch (%s) tests

use Test::More tests => 23;
use Test::More tests => 26;
use DateTime;
use DateTime::Format::Strptime;

Expand All @@ -17,6 +17,15 @@ test(
epoch => $time,
);

# is UTC recognized?
test(
pattern => "%a %d %b %Y %H:%M:%S %p %Z",
time_zone => 'UTC',
locale => 'en_US',
input => "Thu 08 Jul 2010 09:49:02 AM UTC",
epoch => 1278582542,
);

# diag("Epoch with a no given time_zone assumes 'floating'. (Though when given an epoch, really should assume UTC ..)");
{
my $parser = DateTime::Format::Strptime->new(
Expand Down

0 comments on commit 592cc5d

Please sign in to comment.