US/Eastern offset

jladasky at itu.edu jladasky at itu.edu
Thu Dec 22 20:54:32 EST 2016


On Thursday, December 22, 2016 at 3:47:04 PM UTC-8, Christian Heimes wrote:
> 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

Wouldn't most users prefer that modern time zones be the default information returned by pytz, instead of 150 year-old historical time zones?


More information about the Python-list mailing list