diff --git a/id-to-snowflake.sql b/id-to-snowflake.sql index f7643bd..c57bef2 100644 --- a/id-to-snowflake.sql +++ b/id-to-snowflake.sql @@ -1,7 +1,4 @@ --- Helper function to convert Discord IDs into snowflakes purely within Postgres --- Equivalent in Python: --- datetime.utcfromtimestamp(((id >> 22) + DISCORD_EPOCH) / 1000) --- where DISCORD_EPOCH is 1420070400000 +-- Helper function to convert Discord IDs into snowflakes purely within Postgres. CREATE FUNCTION snowflake_time(id BIGINT) RETURNS TIMESTAMP WITH TIME ZONE