Created
August 18, 2021 06:25
-
-
Save omnituensaeternum/57753daee3a926e92747b3d481d43823 to your computer and use it in GitHub Desktop.
Discord Snowflake to Time & Date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This works for most things with discord, such as servers, messages, etc. | |
import datetime | |
def getSnowflakeTimestamp(snowflake): | |
DiscordEpoch = 1420070400000 | |
input = snowflake | |
UnixTSinMS = input / 4194304 + DiscordEpoch | |
out = str(datetime.datetime.fromtimestamp(UnixTSinMS/1000.0)) | |
print("Creation date: " + out) | |
id = 573557883766177832 | |
getSnowflakeTimestamp(id) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment