diff options
| author | Rapptz <[email protected]> | 2021-07-09 04:20:45 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-07-09 04:20:45 -0400 |
| commit | 8fb998b599bda792219e793ae7a48ba92263e44c (patch) | |
| tree | 61e7a028005547b9dfe56fded02f72ea5747a726 /discord/utils.py | |
| parent | Change WEBHOOK_UPDATE to use guild information from gateway (diff) | |
| download | discord.py-8fb998b599bda792219e793ae7a48ba92263e44c.tar.xz discord.py-8fb998b599bda792219e793ae7a48ba92263e44c.zip | |
Refactor utcfromtimestamp to use fromtimestamp(..., tz=utc)
Diffstat (limited to 'discord/utils.py')
| -rw-r--r-- | discord/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/utils.py b/discord/utils.py index b5563a67..9fda2cab 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -323,7 +323,7 @@ def snowflake_time(id: int) -> datetime.datetime: An aware datetime in UTC representing the creation time of the snowflake. """ timestamp = ((id >> 22) + DISCORD_EPOCH) / 1000 - return datetime.datetime.utcfromtimestamp(timestamp).replace(tzinfo=datetime.timezone.utc) + return datetime.datetime.fromtimestamp(timestamp, tz=datetime.timezone.utc) def time_snowflake(dt: datetime.datetime, high: bool = False) -> int: |