Skip to content

fix: replace deprecated datetime.utcnow() with timezone-aware alternative#5

Open
fazalpsinfo-cmyk wants to merge 1 commit into
PythonistaCafe:masterfrom
fazalpsinfo-cmyk:fix/deprecated-datetime-utcnow
Open

fix: replace deprecated datetime.utcnow() with timezone-aware alternative#5
fazalpsinfo-cmyk wants to merge 1 commit into
PythonistaCafe:masterfrom
fazalpsinfo-cmyk:fix/deprecated-datetime-utcnow

Conversation

@fazalpsinfo-cmyk

Copy link
Copy Markdown

Fix Deprecated API Usage

This PR fixes usage of datetime.utcnow()/utcfromtimestamp() which is deprecated in modern Python.

Changes:

  • Replace datetime.utcnow() with datetime.now(datetime.timezone.utc)

Why:

  • datetime.utcnow()/utcfromtimestamp() was deprecated in Python 3.x
  • Using timezone-aware equivalents prevents subtle bugs with timezone handling

If you find this useful, consider buying me a coffee

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