-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
python-telegram-bot/telegram/utils/helpers.py
Lines 78 to 90 in 4397903
| def from_timestamp(unixtime): | |
| """ | |
| Args: | |
| unixtime (int): | |
| Returns: | |
| datetime.datetime: | |
| """ | |
| if not unixtime: | |
| return None | |
| return datetime.fromtimestamp(unixtime) |
Should probably be using tz=timezone.utc. Python's datetime isn't the best, and fromtimestamp by default sets no tz information, which uses the local time, which in turn is generally a bad idea.
Metadata
Metadata
Assignees
Labels
No labels