[Python-Dev] Status on PEP-431 Timezones (original) (raw)

Glenn Linderman v+python at g.nevcal.com
Fri Apr 10 17:57:24 CEST 2015


On 4/10/2015 5:27 AM, Stuart Bishop wrote:

P.S. The description of NonExistentTimeError in the PEP doesn't seem quite >right, as it currently says it will only be thrown if "isdst=None", which >seems like a copy and paste error from the definition of AmbiguousTimeError. The PEP is correct here. If you explicitly specify isdst, you know which side of the transition you are on and which offset to use. You can calculate datetime(2000, 12, 31, 2, 0, 0, 0).astimezone(foo, isdst=False) using the non-DST offset and get an answer. It might not have ever appeared on the clock on your wall, but it is better than a punch in the face. If you want a punch in the face, isdst=None refuses to guess and you get the exception. So does this mean that consistent use of is_dst=False throughout the summer would allow for people that refuse to accept government regulation into their timekeeping, and are willing to be out of step with their neighbors, would be able to match their software to their wall-clock time? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20150410/9552c825/attachment.html>



More information about the Python-Dev mailing list