Skip to content

Commit

Permalink
Update utils.py: make datetime object UTC timezone aware. (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymousx97 authored Nov 28, 2024
1 parent 48d4230 commit 0854967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyrogram/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def zero_datetime() -> datetime:


def timestamp_to_datetime(ts: Optional[int]) -> Optional[datetime]:
return datetime.fromtimestamp(ts) if ts else None
return datetime.fromtimestamp(ts).replace(tzinfo=timezone.utc) if ts else None


def datetime_to_timestamp(dt: Optional[datetime]) -> Optional[int]:
Expand Down

0 comments on commit 0854967

Please sign in to comment.