develooper Front page | perl.datetime | Postings from March 2009

Difference Between America/New_York and EST5EDT When Converting Pre-Time-Zone Times

Thread Next
From:
Jim Monty
Date:
March 14, 2009 16:45
Subject:
Difference Between America/New_York and EST5EDT When Converting Pre-Time-Zone Times
Message ID:
235416.4021.qm@web59207.mail.re1.yahoo.com

I can plainly see that DateTime/TimeZone/America/New_York.pm is not identical to DateTime/TimeZone/EST5EDT.pm, but I don't fully understand what's going on in the following example or why, exactly, the results should differ:
 
 
C:\Perl\site\lib\DateTime\TimeZone>ls -o EST5EDT.pm America/New_York.pm
-r-xr-xr-a   1 CTECFTS\MontyJ     19264 Jan 21 12:47 America/New_York.pm
-r-xr-xr-a   1 CTECFTS\MontyJ     11083 Jan 21 12:47 EST5EDT.pm
 
C:\Perl\site\lib\DateTime\TimeZone>perl -MDateTime::Format::ISO8601 -le "$dt1 = DateTime::Format::ISO8601->parse_datetime('1600-12-31T16:00:00.000-08:00'); my $dt2 = $dt1->clone()->set_time_zone('America/New_York'); print $dt2->format_cldr('yyyy-MM-ddTHH:mm:ss.SSSZ');"
1600-12-31T19:03:58.000-045602
 
C:\Perl\site\lib\DateTime\TimeZone>perl -MDateTime::Format::ISO8601 -le "$dt1 = DateTime::Format::ISO8601->parse_datetime('1600-12-31T16:00:00.000-08:00'); my $dt2 = $dt1->clone()->set_time_zone('EST5EDT'); print $dt2->format_cldr('yyyy-MM-ddTHH:mm:ss.SSSZ');"
1600-12-31T19:00:00.000-0500
 
C:\Perl\site\lib\DateTime\TimeZone>
 
 
-- 
Jim Monty


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About