Skip to content

Conversation

@sklart
Copy link
Contributor

@sklart sklart commented Nov 5, 2025

  • Updated all occurrences of datetime.utcnow() to datetime.now(timezone.utc) to comply with modern Python standards and avoid DeprecationWarning.
    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). session_doc["updated_at"] = datetime.utcnow().isoformat()
  • Added timezone to datetime imports where missing.
  • Ensures created_at and updated_at fields are now timezone-aware UTC datetimes.
  • Maintains compatibility with Python >=3.2.

- Updated all occurrences of datetime.utcnow() to datetime.now(timezone.utc) to comply with modern Python standards and avoid DeprecationWarning.
'''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). session_doc["updated_at"] = datetime.utcnow().isoformat()'''
- Added `timezone` to datetime imports where missing.
- Ensures created_at and updated_at fields are now timezone-aware UTC datetimes.
- Maintains compatibility with Python >=3.2.
- Updated all occurrences of datetime.utcnow() to datetime.now(timezone.utc) to comply with modern Python standards and avoid DeprecationWarning.
`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). session_doc["updated_at"] = datetime.utcnow().isoformat()`
- Added `timezone` to datetime imports where missing.
- Ensures created_at and updated_at fields are now timezone-aware UTC datetimes.
- Maintains compatibility with Python >=3.2.
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