datetime.datetime.today()

Skip Montanaro skip.montanaro at gmail.com
Wed Sep 16 16:16:36 CEST 2015


On Wed, Sep 16, 2015 at 8:55 AM, Nick Sarbicki <nick.a.sarbicki at gmail.com>
wrote:

> Just in the case you didn't figure it out:
>
>  >>> datetime.datetime.today()
> datetime.datetime(2015, 9, 16, 14, 50, 47, 700828)
> >>> datetime.date.today()
> datetime.date(2015, 9, 16)
>

Yeah, I was aware of that. That is partly why I thought
datetime.datetime.today() would return a date object. In English, "today"
and "now" mean different things, so it makes some sense that they would
behave differently as methods of datetime objects.

Thx,

S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150916/001e643a/attachment.html>


More information about the Python-list mailing list