> From: Guido van Rossum [mailto:[EMAIL PROTECTED]
> 
> >>> 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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to