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

Updated releaseWizard.py to use timezone-aware objects to represent datetimes in UTC #14102

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shubhamsrkdev
Copy link

@shubhamsrkdev shubhamsrkdev commented Jan 4, 2025

Quoting from python release doc :

datetime: datetime.datetime’s utcnow() and utcfromtimestamp() are deprecated and will be removed in a future version. Instead, use timezone-aware objects to represent datetimes in UTC: respectively, call now() and fromtimestamp() with the tz parameter set to datetime.UTC.

Owing to this made two types of changes:

  1. Replaced datetime.utcnow() with datetime.now(tz=timezone.utc)
  2. Replaced datetime.utcfromtimestamp(timestamp1) with datetime.fromtimestamp(timestamp=timestamp1, tz=timezone.utc)

Fixes #14063

@shubhamsrkdev
Copy link
Author

@ChrisHegarty / @rmuir fyi please check this whenever convenient. TIA!

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.

releaseWizard.py DeprecationWarning: datetime.datetime.utcnow() is deprecated
1 participant