Skip to content

datetime documentation regarding ISO8601 reduced precision and extend representation #105031

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

Closed
nhhollander opened this issue May 27, 2023 · 1 comment · Fixed by #105049
Closed
Labels
docs Documentation in the Doc dir

Comments

@nhhollander
Copy link
Contributor

nhhollander commented May 27, 2023

Documentation

The documentation for date.fromisoformat(), and datetime.fromisoformat() refer to these function as as being able to accept "any valid ISO 8601 format", however there are a couple notable exceptions to this support beyond what is already mentioned in the documentation. I know that Python's date parsing code intentionally does not implement the full ISO 8601 specification for simplicity reasons, but I feel like this could be better conveyed by the current documentation.

Below is a summary of ISO 8601 date stamps that are not supported by the datetime module.

  • Reduced Precision Date Representations (ISO8601-1:2019§5.2.2.2)
  • Extended Date Representations (ISO8601-1:2019§5.2.2.3)
  • Ordinal Date Representations (ISO8601-1:2019§5.2.3): This is already mentioned in the documentation
  • Local Time Representations with Decimal Fraction (ISO8601-1:2019§5.3.1.4): This is already mentioned in the documentation

Linked PRs

@nhhollander nhhollander added the docs Documentation in the Doc dir label May 27, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 1, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 1, 2024
serhiy-storchaka pushed a commit that referenced this issue Feb 1, 2024
…) (GH-114867)

(cherry picked from commit e9dab65)

Co-authored-by: Nicholas Hollander <[email protected]>
serhiy-storchaka pushed a commit that referenced this issue Feb 1, 2024
…) (GH-114866)

(cherry picked from commit e9dab65)

Co-authored-by: Nicholas Hollander <[email protected]>
@serhiy-storchaka
Copy link
Member

Thank you for your contribution @nhhollander.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants