Skip to content

fix : replaced deprecated datetime.utcnow with timezone-aware alternative - #1344

Open
tmdeveloper007 wants to merge 1 commit into
komalharshita:mainfrom
tmdeveloper007:#1339
Open

fix : replaced deprecated datetime.utcnow with timezone-aware alternative#1344
tmdeveloper007 wants to merge 1 commit into
komalharshita:mainfrom
tmdeveloper007:#1339

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Summary of What Has Been Done

Replaced all 10 occurrences of datetime.utcnow() in src/utils/privacy.py with datetime.now(timezone.utc) to address the Python 3.12 deprecation of datetime.utcnow().

Changes Made

  • Updated import: from datetime import datetime -> from datetime import datetime, timezone
  • Replaced all datetime.utcnow() calls with datetime.now(timezone.utc)

Impact it Made

  • Forward-compatibility with Python 3.12 and beyond
  • Eliminates deprecation warnings in newer Python versions
  • Follows current Python best practices for UTC datetime handling

Closes #1339

Note: Please assign this PR to the tmdeveloper007 account.

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : replace deprecated datetime.utcnow in privacy.py with timezone-aware alternative

1 participant