[Zope3-dev] pytz daylight savings bug?

Bernd Dorn zope-mailinglist at mopa.at
Sun Apr 30 09:56:57 EDT 2006


Hello

I don't know if should put this on the zope3 tracker or somewhere  
else so i post it to the list too.

in pytz the daylight savings are not correctly returned by the dst()  
methods, i looked into the source code and saw that the passed in  
datetime is ignored imho this should be used to get the utc offset at  
that given datetime. the same applies to utcoffset()

example which fails:

import pytz
from datetime import datetime
import time

tz = pytz.timezone('Europe/Vienna')
dt = datetime(2006,5,30,12,tzinfo=tz)
dt2 = datetime(2006,1,30,12,tzinfo=tz)

assert(dt.dst()!=dt2.dst())






More information about the Zope3-dev mailing list