Skip to content

Removed deprecated function utcnow#11

Open
pastanton wants to merge 1 commit into
lancejames221b:mainfrom
pastanton:utcnow
Open

Removed deprecated function utcnow#11
pastanton wants to merge 1 commit into
lancejames221b:mainfrom
pastanton:utcnow

Conversation

@pastanton

Copy link
Copy Markdown
Contributor

Fixed deprecated (as of python 3.12) utcnow syntax.

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). after = datetime.utcnow()

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).
after = datetime.utcnow()
@pastanton

Copy link
Copy Markdown
Contributor Author

Originally used datetime.UTC, but that wasn't introduced until 3.11 or so. Replaced with datetime.timezone.utc to be compatible with 3.9+ w/o deprecation warnings.

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