> From: Guido van Rossum [mailto:gvanrossum at gmail.com] > > >>> datetime.datetime.utcfromtimestamp(time.time()) - datetime.datetime.utcnow() > datetime.timedelta(0) I overlooked the utcfromtimestamp method, sorry. > Your bug is similar to comparing centimeters to inches, or speed to > acceleration, or any number of similar mistakes. Quite so, and that is exactly the point. time.time() unambiguously identifies a point in time. A datetime object does not. At least not unless a tzinfo object is included, and even then there is a corner case at the end of DST that cannot possibly be handled. If ctime/mtime/atime were to return datetime objects, that would pretty much have to be UTC to not lose information in the DST transition. I doubt that's what Walter wanted though, as that would leave users with the job of converting from UTC datetime to local datetime; - unless perhaps I've overlooked a convenient UTC->local conversion method? - Anders
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4