Skip to content

Instantly share code, notes, and snippets.

@omnituensaeternum
Created August 18, 2021 06:25
Show Gist options
  • Save omnituensaeternum/57753daee3a926e92747b3d481d43823 to your computer and use it in GitHub Desktop.
Save omnituensaeternum/57753daee3a926e92747b3d481d43823 to your computer and use it in GitHub Desktop.
Discord Snowflake to Time & Date
#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