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

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

Thread Previous | Thread Next
From:
Dave Rolsky
Date:
March 16, 2017 06:13
Subject:
Re: FW: timelocal() discrepancy vs DateTime->epoch
Message ID:
alpine.DEB.2.20.1703160109130.15731@urth.org
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.


Cheers,

Dave Rolsky
http://blog.urth.org
https://github.com/autarch
Thread Previous | 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