Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strptime/strftime format code examples #100574

Open
ezio-melotti opened this issue Dec 28, 2022 · 0 comments
Open

Add strptime/strftime format code examples #100574

ezio-melotti opened this issue Dec 28, 2022 · 0 comments
Assignees
Labels
3.10 3.11 3.12 docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@ezio-melotti
Copy link
Member

ezio-melotti commented Dec 28, 2022

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.

I therefore suggest the following changes:

  1. add an example before the table with the format codes, showing some of the most common codes;
  2. add links to (date|time|datetime).isoformat in the docs for (date|time|datetime).strptime;
  3. add links to datetime.fromisoformat in the docs for datetime.strptime (date and time have a .fromisoformat method, but no .strptime method);

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 3.11 3.12 docs Documentation in the Doc dir type-feature A feature request or enhancement
Projects
Status: In Progress
Development

No branches or pull requests

1 participant