Skip to content

Commit bebb241

Browse files
REQUESTED CHANGES
1 parent 0201347 commit bebb241

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Doc/library/datetime.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,8 +2432,7 @@ Class attributes:
24322432

24332433
:class:`date`, :class:`.datetime`, and :class:`.time` objects all support a
24342434
``strftime(format)`` method, to create a string representing the time under the
2435-
control of an explicit format string. A :exc:`ValueError` will be raised if digits
2436-
are not ASCII.
2435+
control of an explicit format string.
24372436

24382437
Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and
24392438
:meth:`time.strptime` class methods create an object from a string
@@ -2618,6 +2617,8 @@ differences between platforms in handling of unsupported format specifiers.
26182617
Technical Detail
26192618
^^^^^^^^^^^^^^^^
26202619

2620+
A :exc:`ValueError` will be raised if digits are not ASCII.
2621+
26212622
Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's
26222623
``time.strftime(fmt, d.timetuple())`` although not all objects support a
26232624
:meth:`~date.timetuple` method.

Doc/library/time.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ Functions
431431
:func:`gmtime` or :func:`localtime` to a string as specified by the *format*
432432
argument. If *t* is not provided, the current time as returned by
433433
:func:`localtime` is used. *format* must be a string. :exc:`ValueError` is
434-
raised if any field in *t* is outside of the allowed range.
434+
raised if any field in *t* is outside of the allowed range or if digits are
435+
not ASCII.
435436

436437
0 is a legal argument for any position in the time tuple; if it is normally
437438
illegal the value is forced to a correct one.
@@ -591,11 +592,11 @@ Functions
591592

592593
The *format* parameter uses the same directives as those used by
593594
:func:`strftime`; it defaults to ``"%a %b %d %H:%M:%S %Y"`` which matches the
594-
formatting returned by :func:`ctime`.
595-
If *string* cannot be parsed according to *format*, if it has excess data
596-
after parsing, or if digits are not ASCII, a :exc:`ValueError` is raised. The
597-
default values, ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``, are used to fill in any
598-
missing data when more accurate values cannot be inferred.
595+
formatting returned by :func:`ctime`. If *string* cannot be parsed according
596+
to *format*, or if it has excess data after parsing, :exc:`ValueError` is
597+
raised. The default values used to fill in any missing data when more
598+
accurate values cannot be inferred are ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``.
599+
Both *string* and *format* must be strings.
599600

600601
For example:
601602

0 commit comments

Comments
 (0)