mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Merge 998e4e8f3d into 7099af8f5e
This commit is contained in:
commit
ce3f333ed3
1 changed files with 5 additions and 0 deletions
|
|
@ -2495,6 +2495,11 @@ These methods accept format codes that can be used to parse and format dates::
|
||||||
>>> _.strftime('%a %d %b %Y, %I:%M%p')
|
>>> _.strftime('%a %d %b %Y, %I:%M%p')
|
||||||
'Mon 31 Jan 2022, 11:59PM'
|
'Mon 31 Jan 2022, 11:59PM'
|
||||||
|
|
||||||
|
The user has to make sure, though, that the input can be parsed in a unambiguous
|
||||||
|
way. The string ``2025112`` can be parsed using the format ``%Y%m%d`` as ``2025-1-12``,
|
||||||
|
``2025-11-2``, or even ``20251-1-2``. It is necessary to add appropriate separators to
|
||||||
|
reliably get results.
|
||||||
|
|
||||||
The following is a list of all the format codes that the 1989 C standard
|
The following is a list of all the format codes that the 1989 C standard
|
||||||
requires, and these work on all platforms with a standard C implementation.
|
requires, and these work on all platforms with a standard C implementation.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue