tzinfo utcoffset(), dst() & tzname() methods ignore arguments

Bug #148307 reported by Amos Latteier on 2007-10-02
Affects Status Importance Assigned to Milestone

Bug Description

I was surprised to see that utcoffset(), dst() and tzname() methods of pytz tzinfo instances don't seem to take the datetime object passed to those methods into account.

From the way I read the python docs on tzinfo objects, these methods should return information that's tailored to the passed in datetime. In other words, these methods should reflect whether the passed in datetime is in daylight saving time or not. I'll also note that the classes in pytz.reference do work this way.

Perhaps I don't understand the correct way to use the tzinfo instances that pytz creates. The documentation doesn't seem to cover the use of the utcoffset(), dst(), and tzname() methods.

Thanks for your excellent work on pytz!


Stuart Bishop (stub) wrote :

The pytz tzinfo instances need to do things differently because it attempts to do things the Python datetime library never intended.

Changed in pytz:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers