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

Fix: datetime.datetime.utcnow() is deprecated ... #1922

Merged
merged 1 commit into from
May 9, 2024

Conversation

ValueRaider
Copy link
Collaborator

I upgraded Python 3.11 -> 3.12 and get this new warning:

DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).

Simple to fix.

@ValueRaider
Copy link
Collaborator Author

ValueRaider commented Apr 29, 2024

Problem: breaks if Python older than 3.11. Solved

@ValueRaider ValueRaider marked this pull request as draft April 29, 2024 18:19
@ValueRaider ValueRaider force-pushed the fix/datetime-utc-warning branch 2 times, most recently from c5aead9 to d1cbe90 Compare May 2, 2024 21:29
@ValueRaider ValueRaider marked this pull request as ready for review May 2, 2024 21:44
Python 3.12 deprecates datetime.datetime.utcnow().
Instead of switching to datetime.datetime.now(datetime.UTC), which won't work in Python 3.11,
just switch to Pandas.utcnow().
@ValueRaider ValueRaider force-pushed the fix/datetime-utc-warning branch from d1cbe90 to dc5c718 Compare May 2, 2024 21:45
@ValueRaider ValueRaider merged commit 098e776 into dev May 9, 2024
1 check passed
@ValueRaider ValueRaider deleted the fix/datetime-utc-warning branch May 9, 2024 18:38
@ValueRaider ValueRaider mentioned this pull request May 9, 2024
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.

1 participant