[New-bugs-announce] [issue31498] Default values for zero in time.strftime()
Denis Osipov
report at bugs.python.org
Sun Sep 17 13:06:56 EDT 2017
New submission from Denis Osipov:
Now default values for zero in time.strftime returns string with day of week value 1:
>>> time.strftime("%Y %m %d %H %M %S %w %j", (2000,)+(0,)*8)
'2000 01 01 00 00 00 1 001'
while 2000-01-01 is Saturday (=6th day of week).
Now each illegal value (day of month < 1 etc.) are forced to a correct one (by the way why now day of week isn't 0=Sunday and forced to 1). Maybe strftime also should force day of week to according to the date (%Y %m %d) if it's given.
>>> time.strftime("%Y %m %d %H %M %S %w %j", (2000,)+(0,)*8)
'2000 01 01 00 00 00 6 001'
----------
components: Interpreter Core
messages: 302374
nosy: denis-osipov
priority: normal
severity: normal
status: open
title: Default values for zero in time.strftime()
type: behavior
versions: Python 3.6, Python 3.7
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31498>
_______________________________________
More information about the New-bugs-announce
mailing list