[New-bugs-announce] [issue12006] strptime should implement %V or %u directive from libc
report at bugs.python.org
Thu May 5 12:03:43 CEST 2011
New submission from Erik Cederstrand <ec at 1calendar.dk>:
Python is via datetime.isocalendar() able to produce the ISO week number and ISO weekday from a given date. But it is not possible to do the reverse; calculate the date from a year, ISO week number and weekday.
libc strptime()/strftime() mentions a %V and %u directive which does this, i.e. Monday in ISO week 22 of the year 2011:
returning 2011-05-30 and
libc (on FreeBSD) has this to say:
%V is replaced by the week number of the year (Monday as the first day
of the week) as a decimal number (01-53). If the week containing
January 1 has four or more days in the new year, then it is week 1;
otherwise it is the last week of the previous year, and the next
week is week 1.
%u is replaced by the weekday (Monday as the first day of the week) as
a decimal number (1-7).
components: Library (Lib)
title: strptime should implement %V or %u directive from libc
type: feature request
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce