This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients belopolsky, p-ganssle, tim.peters, vstinner
Date 2018-01-09.15:56:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1515513402.38.0.467229070634.issue32522@psf.upfronthosting.co.za>
In-reply-to
Content
> dt = datetime.now(precision='day')

Why not creating a date and then convert it to a datetime object?

> dt = datetime.now().replace(microseconds=0)

Yeah, that one annoys me as well, but I learnt the .replace(microseconds=0) hack, or how to format without microseconds.

By the way, are you aware of Python 3.7 enhancement of .isoformat(), the new timespec parameter?
https://docs.python.org/dev/library/datetime.html#datetime.datetime.isoformat
History
Date User Action Args
2018-01-09 15:56:42vstinnersetrecipients: + vstinner, tim.peters, belopolsky, p-ganssle
2018-01-09 15:56:42vstinnersetmessageid: <1515513402.38.0.467229070634.issue32522@psf.upfronthosting.co.za>
2018-01-09 15:56:42vstinnerlinkissue32522 messages
2018-01-09 15:56:42vstinnercreate