mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-23 00:42:56 +00:00
Refactor utcfromtimestamp to use fromtimestamp(..., tz=utc)
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user