Skip to content

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