summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhishek Kumar Singh <toanant@users.noreply.github.com>2019-05-18 20:36:19 (GMT)
committerCheryl Sabella <cheryl.sabella@gmail.com>2019-05-18 20:36:19 (GMT)
commit56027ccd6b9dab4a090e4fef8574933fb9a36ff2 (patch)
tree1b6c44ac8def221d86b64a4cd4116e7020115413
parentabea73bf4a320ff658c9a98fef3d948a142e61a9 (diff)
downloadcpython-56027ccd6b9dab4a090e4fef8574933fb9a36ff2.zip
cpython-56027ccd6b9dab4a090e4fef8574933fb9a36ff2.tar.gz
cpython-56027ccd6b9dab4a090e4fef8574933fb9a36ff2.tar.bz2
bpo-19376: Added doc mentioning `datetime.strptime()` without a year fails for Feb 29. (GH-10243)
-rw-r--r--Doc/library/datetime.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index abdc977..3c45e56 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -2048,6 +2048,9 @@ For :class:`date` objects, the format codes for hours, minutes, seconds, and
microseconds should not be used, as :class:`date` objects have no such
values. If they're used anyway, ``0`` is substituted for them.
+For the :meth:`datetime.strptime` class method, the default value is ``1900-01-01T00:00:00.000``:
+any components not specified in the format string will be pulled from the default value. [#]_
+
The full set of format codes supported varies across platforms, because Python
calls the platform C library's :func:`strftime` function, and platform
variations are common. To see the full set of format codes supported on your
@@ -2282,3 +2285,4 @@ Notes:
.. rubric:: Footnotes
.. [#] If, that is, we ignore the effects of Relativity
+.. [#] Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is not a leap year.