diff options
author | Paul Ganssle <pganssle@users.noreply.github.com> | 2019-04-29 13:22:03 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-04-29 13:22:03 (GMT) |
commit | 88c093705615c50c47fdd9ab976803f73de7e308 (patch) | |
tree | 4a76496a2c930d1e27e020555f4b91e2b43f777b /Doc/library/datetime.rst | |
parent | a86e06433a010f873dfd7957e0f87a39539876ee (diff) | |
download | cpython-88c093705615c50c47fdd9ab976803f73de7e308.zip cpython-88c093705615c50c47fdd9ab976803f73de7e308.tar.gz cpython-88c093705615c50c47fdd9ab976803f73de7e308.tar.bz2 |
bpo-36004: Add date.fromisocalendar (GH-11888)
This commit implements the first version of date.fromisocalendar, the
inverse function for date.isocalendar.
Diffstat (limited to 'Doc/library/datetime.rst')
-rw-r--r-- | Doc/library/datetime.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 1ee23c2..abdc977 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -458,6 +458,13 @@ Other constructors, all class methods: .. versionadded:: 3.7 +.. classmethod:: date.fromisocalendar(year, week, day) + + Return a :class:`date` corresponding to the ISO calendar date specified by + year, week and day. This is the inverse of the function :meth:`date.isocalendar`. + + .. versionadded:: 3.8 + Class attributes: @@ -854,6 +861,16 @@ Other constructors, all class methods: .. versionadded:: 3.7 + +.. classmethod:: datetime.fromisocalendar(year, week, day) + + Return a :class:`datetime` corresponding to the ISO calendar date specified + by year, week and day. The non-date components of the datetime are populated + with their normal default values. This is the inverse of the function + :meth:`datetime.isocalendar`. + + .. versionadded:: 3.8 + .. classmethod:: datetime.strptime(date_string, format) Return a :class:`.datetime` corresponding to *date_string*, parsed according to |