Skip to content

refactor: Timestamp parsing to handle timezone information #587

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

KellianL
Copy link

Description

This PR fixes the timestamp parsing in Report._extract_timestamp() to properly handle ISO 8601 timestamps that include timezone information.

Solution

  • Replaced datetime.strptime() with datetime.fromisoformat() which correctly handles timezone information

Fixes #586

Use `datetime.fromisoformat` instead of `datetime.strptime`
@KellianL KellianL requested a review from a team as a code owner April 10, 2025 09:26
@KellianL KellianL changed the title Refactor: Timestamp parsing to handle timezone information refactor: Timestamp parsing to handle timezone information Apr 10, 2025
@KellianL
Copy link
Author

Test are running using Python version 3.10.
The method used here to handle timestamp (timedate.fromisoformat) is available since Python 3.8 but only support most ISO 8601 formats since Python 3.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timestamp parsing failure with timezone information
1 participant