[New-bugs-announce] [issue35841] Datetime strftime() does not return correct week numbers for 2019
Tommy Rowland
report at bugs.python.org
Mon Jan 28 07:32:09 EST 2019
New submission from Tommy Rowland <thomasrowland1 at googlemail.com>:
This relates to the calculation of the week number from a given datetime, when calling the strftime method. If you call isocalendar() on the datetime.datetime object for the date ‘2018-12-31’, the week number returned is 1, which is correct. This is the same when checking the week attribute for the pandas timestamp equivalent. However, when you call strftime on this object (either datetime or timestamp), passing the ‘%W’ offset string, it returns 53, and then returns 00 for the remainder of the week. It seems that the rest of the weeks in 2019 are out by 1 when returned using this function. This issue seems to be present with the strptime function also.
----------
components: Extension Modules, Windows
files: Python Datetime Issue.JPG
messages: 334462
nosy: paul.moore, steve.dower, tim.golden, tr12, zach.ware
priority: normal
severity: normal
status: open
title: Datetime strftime() does not return correct week numbers for 2019
type: behavior
versions: Python 2.7, Python 3.6
Added file: https://bugs.python.org/file48083/Python Datetime Issue.JPG
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35841>
_______________________________________
More information about the New-bugs-announce
mailing list