Donald Stufft added the comment:

It's actually a bit worse than that Nick. It's midnight UTC, as long as the UTC 
offset is Positive or Zero. This is because the way the check is implemented is 
naive.

It's implemented as: Take the time portion sans the tzinfo and convert to 
minutes, then take the utc offset and convert that to minutes, then subtract 
the second from the first and if that is zero it is False.

So if you take -5 for instance (my own timezone!) the equation to determine 
when the "False" time is would look like:

x - (-5 * 60) = 0
x - (-300) = 0
x + 300 = 0
x = -300

So we'd need a time that can be represented as -300 minutes. Since times can 
not be negative that means for a timezone aware time it is impossible for 
something with a negative UTC offset to ever be False while for a zero or 
positive UTC offset it'll be False at UTC midnight.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13936>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to