[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

Guido van Rossum report at bugs.python.org
Tue Mar 1 16:48:07 EST 2016


Guido van Rossum added the comment:

Except for the case where you're closer than half a usec from the next value, IMO rounding makes no sense when suppressing digits. I most definitely would never want 9:59:59 to be rounded to 10:00 when suppressing seconds. If you really think there are use cases for that you could add a 'round=True' flag (as long as it defaults to False). That seems better than supporting rounding on datetime objects themselves. But I think you're just speculating.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19475>
_______________________________________


More information about the Python-bugs-list mailing list