Skip to content

Commit e29e51a

Browse files
committed
cover date.strptime (3.14) as well
1 parent 6330e73 commit e29e51a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Doc/library/datetime.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,15 +2651,15 @@ Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's
26512651
``time.strftime(fmt, d.timetuple())`` although not all objects support a
26522652
:meth:`~date.timetuple` method.
26532653

2654-
For the :meth:`.datetime.strptime` class method, the default value is
2655-
``1900-01-01T00:00:00.000``: any components not specified in the format string
2656-
will be pulled from the default value.
2654+
For the :meth:`.datetime.strptime` and :meth:`.date.strptime` class methods,
2655+
the default value is ``1900-01-01T00:00:00.000``: any components not specified
2656+
in the format string will be pulled from the default value.
26572657

26582658
.. note::
2659-
When used to parse partial dates lacking a year, :meth:`~.datetime.strptime`
2660-
will raise when encountering February 29 because its default year of 1900 is
2661-
*not* a leap year. Always add a default leap year to partial date strings
2662-
before parsing.
2659+
When used to parse partial dates lacking a year, :meth:`.datetime.strptime`
2660+
and :meth:`.date.strptime` will raise when encountering February 29 because
2661+
the default year of 1900 is *not* a leap year. Always add a default leap
2662+
year to partial date strings before parsing.
26632663

26642664

26652665
.. testsetup::

0 commit comments

Comments
 (0)