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

Re: FW: timelocal() discrepancy vs DateTime->epoch

Thread Previous | Thread Next
Dave Rolsky
March 16, 2017 06:13
Re: FW: timelocal() discrepancy vs DateTime->epoch
Message ID:
On Tue, 14 Mar 2017, Lu Feng wrote:

> I noticed that the UNIX time from timelocal() started to differ from that you get from using DateTime module, for dates earlier than 11/6/1910.
> For the America/New_York local timezone, timelocal() thinks there was a DST switch on 11/6/1910, while DateTime module thinks there was none.

I'm pretty sure timelocal() is wrong here, though I'm not sure why. There 
was no DST transition in that zone in 1910. In fact, there wasn't really a 
time zone until 1918. The pre-1918 zone file in the Olson database is just 
using local solar time, but it's not very meaningful. If you really care 
about local times in the early 1900s you probably need to calculate the 
solar noon for the given lat/long.


Dave Rolsky
Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About