datetime.datetime.today()

Skip Montanaro skip.montanaro at gmail.com
Wed Sep 16 09:47:01 EDT 2015


This surprised me today:

>>> import datetime
>>> datetime.datetime.today(), datetime.datetime.now()
(datetime.datetime(2015, 9, 16, 8, 44, 7, 723560), datetime.datetime(2015,
9, 16, 8, 44, 7, 723577))

I naively expected today() to always return a datetime.date object. Oh
well, bug in my code has been squashed.

Skip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150916/6d32ff72/attachment.html>


More information about the Python-list mailing list