US/Eastern offset

Christian Heimes christian at python.org
Thu Dec 22 18:46:33 EST 2016


On 2016-12-22 21:49, Skip Montanaro wrote:
> In a small application I realized I needed all my timestamps to have
> timezone info. Some timestamp strings come in with no TZ markings, but
> I know they are US/Eastern. so, I built one:
> 
>>>> import pytz
>>>> tz = pytz.timezone("US/Eastern")
>>>> tz
> <DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD>
> 
> What's with those extra four minutes? Here is one such timestamp I
> logged in my app:
> 
>     2016-12-22T20:35:05-04:56
> 
> WTF? Has my brain turned to mush, and the people in New York now move
> so fast that they are four minutes closer to their London counterparts
> than they used to be?

pytz contains not only current time zone, but also historic time zones.
You are looking at a time zone without a date and time context. Without
a context, pytz shows you a historic time zone information. In your case
pytz gives you the local mean time (solar time) the 19th century.

Christian






More information about the Python-list mailing list