Skip to content

fix: update deprecated utcnow to timezone-aware utc datetimes#578

Merged
Jayprakash-SE merged 1 commit into
hatnote:masterfrom
ItsAbhinavM:572-replace-utctimezone
Jun 7, 2026
Merged

fix: update deprecated utcnow to timezone-aware utc datetimes#578
Jayprakash-SE merged 1 commit into
hatnote:masterfrom
ItsAbhinavM:572-replace-utctimezone

Conversation

@ItsAbhinavM

Copy link
Copy Markdown
Contributor

Description

Fixes #572

Updates all the datetime.utcnow instance with datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None) which is timezone-aware. I have also added an extra .replace(tznifo=None), since otherwise datetime will return can’t compare offset-naive and offset-aware datetimes error as datetime objects and the codebase requires timezone-naive datetime objects.

@Jayprakash-SE Jayprakash-SE merged commit fdd6612 into hatnote:master Jun 7, 2026
4 checks passed
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.

Replace datetime.utcnow() with timezone-aware UTC datetimes (Python 3.14 compatibility)

2 participants