STINNER Victor <victor.stin...@gmail.com> added the comment:

> 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

----------
nosy: +vstinner

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32522>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to