Currently the docs for datetime.strptime and datetime.strftime don't include an example but have a link to the table with the format codes, where I end up having to reconstruct the right combination every time. At the end of each class docs there are some examples, but there are no links pointing to them, so they aren't easily discoverable. In addition, the .(from)isoformat methods can often be used instead of strftime/strptime.
ezio-melotti commentedDec 28, 2022
•
edited by bedevere-bot
Currently the docs for
datetime.strptime
anddatetime.strftime
don't include an example but have a link to the table with the format codes, where I end up having to reconstruct the right combination every time. At the end of each class docs there are some examples, but there are no links pointing to them, so they aren't easily discoverable. In addition, the.(from)isoformat
methods can often be used instead ofstrftime
/strptime
.I therefore suggest the following changes:
(date|time|datetime).isoformat
in the docs for(date|time|datetime).strptime
;datetime.fromisoformat
in the docs fordatetime.strptime
(date
andtime
have a.fromisoformat
method, but no.strptime
method);Linked PRs
strptime
/strftime
docs #100575The text was updated successfully, but these errors were encountered: