Skip to content

Allow using datetime.timezone.utc for UTC timestampts #804

Closed Answered by dvarrazzo
adriangb asked this question in Q&A
Discussion options

You must be logged in to vote

They are two different python objects but they have the same semantic as timezone info objects:

>>> datetime.datetime(2000, 1, 1, tzinfo=datetime.timezone.utc) \
... == datetime.datetime(2000, 1, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='UTC'))
True

I wouldn't want to ensure the identity of the object we return.

(I see you got to the same conclusion of semantic equivalence).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by adriangb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants