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

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

Thread Previous
From:
Zefram
Date:
March 15, 2009 02:59
Subject:
Re: Difference Between America/New_York and EST5EDT When Converting Pre-Time-Zone Times
Message ID:
20090315095929.GA9046@fysh.org
Jim Monty wrote:
>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:

"America/New_York" refers to the civil time historically used in New
York City, as best the Olson folks can determine it.  For the date you
tried (which slightly predates the founding of the first European-style
settlement in that region) it's using local mean time.

"EST5EDT", on the other hand, is a System V-style timezone specification.
It specifies that the zone uses a standard time of UT-5h called "EST",
a DST of UT-4h called "EDT", and switches between them annually on
some unspecified dates that the implementation must guess.  For the
date you tried it's obliged to pick one or the other of these offsets,
and since the usual guesses involve northern-hemisphere chauvinism
it's overwhelmingly likely to pick the standard time for a date in
December/January.  See DT::TZ::SystemV (a separate distribution) for
documentation explaining the syntax, although for historical reasons
DT::TZ::EST5EDT is implementing "EST5EDT" via an Olson-style observance
listing rather than via DT::TZ::SystemV.

-zefram

Thread Previous


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