Skip to content

Replace deprecated datetime.datetime.utcnow#480

Open
kajinamit wants to merge 1 commit intoPylons:mainfrom
kajinamit:utcnow
Open

Replace deprecated datetime.datetime.utcnow#480
kajinamit wants to merge 1 commit intoPylons:mainfrom
kajinamit:utcnow

Conversation

@kajinamit
Copy link
Copy Markdown

@kajinamit kajinamit commented Jun 9, 2025

The utcnow function was deprecated in Python 3.12[1].

Note that all datetime instances are kept non-timezone-aware to keep backword-compatibility.

[1] https://docs.python.org/3.13/library/datetime.html#datetime.datetime.utcnow

@kajinamit kajinamit force-pushed the utcnow branch 3 times, most recently from 21641ad to 1e799b5 Compare June 9, 2025 14:48
@piotr-dobrogost
Copy link
Copy Markdown

Related issue #473

@kajinamit kajinamit closed this Feb 8, 2026
@kajinamit kajinamit reopened this Feb 8, 2026
@kajinamit kajinamit force-pushed the utcnow branch 2 times, most recently from 71a2f91 to 46d284e Compare February 8, 2026 13:06
@miketheman
Copy link
Copy Markdown
Contributor

Duplicate of #475 and does a lot more - looks like you ran an auto-formatter or something changed a lot more lines than is relevant?

The utcnow function was deprecated in Python 3.12[1].

Note that all datetime instances are kept non-timezone-aware to keep
backword-compatibility.

[1] https://docs.python.org/3.13/library/datetime.html#datetime.datetime.utcnow
@kajinamit
Copy link
Copy Markdown
Author

Duplicate of #475 and does a lot more - looks like you ran an auto-formatter or something changed a lot more lines than is relevant?

That was due to the base commit to fix the lint check error. I removed that commit, because it was merged separately.

"parse_date",
"serialize_date",
"parse_date_delta",
"serialize_date_delta",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think utcnow should be added to __all__ since this module is following that pattern.

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.

4 participants