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.strptimeanddatetime.strftimedon'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)isoformatmethods can often be used instead ofstrftime/strptime.I therefore suggest the following changes:
(date|time|datetime).isoformatin the docs for(date|time|datetime).strptime;datetime.fromisoformatin the docs fordatetime.strptime(dateandtimehave a.fromisoformatmethod, but no.strptimemethod);Linked PRs
strptime/strftimedocs #100575The text was updated successfully, but these errors were encountered: