mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Refactor utcfromtimestamp to use fromtimestamp(..., tz=utc)
This commit is contained in:
1 parent
826ce101fd
commit
8fb998b599
3 files changed
+10
-11
No files matched your search
+1
-1
@@ -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