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

Added a timezone object to the datetime object generated in cql_to_py for timestamps #50

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ronharel02
Copy link

@ronharel02 ronharel02 commented Jun 23, 2024

I think this is a good addition for situations where timestamps queried from the database need to be compared with datetime objects acquired from other sources that may be set to a different timezone.

I'm not very acquainted with PyO3 so this can probably be implemented in a cleaner way... I would love to help improve this addition :)

@ronharel02 ronharel02 changed the title Added a timezone object to the DateTime object generated in cql_to_py. Added a timezone object to the datetime object generated in cql_to_py fo timestamps. Jun 23, 2024
@ronharel02 ronharel02 changed the title Added a timezone object to the datetime object generated in cql_to_py fo timestamps. Added a timezone object to the datetime object generated in cql_to_py for timestamps. Jun 23, 2024
@ronharel02 ronharel02 changed the title Added a timezone object to the datetime object generated in cql_to_py for timestamps. Added a timezone object to the datetime object generated in cql_to_py for timestamps Jun 23, 2024
@s3rius
Copy link
Member

s3rius commented Oct 31, 2024

I would disagree with this change, because timestamps are generally timezone independent.

https://stackoverflow.com/a/23062640

You can always assume that returned datetime in UTC. So, instead of calculating an offset, you can set it statically to UTC.

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.

2 participants