How 64-Bit Snowflake IDs Store Time
Large distributed platforms cannot rely on a single database auto-increment counter because millions of messages arrive every second across different servers. Twitter created the Snowflake format in 2010 to generate unique, time-sorted 64-bit integers independently on every server node.
Verified Platform Epoch Values
| Platform | Epoch Date (UTC) | Offset (Milliseconds) | Bit Shift |
|---|---|---|---|
| Discord | 2015-01-01 00:00:00.000 | 1420070400000 | >> 22 |
| Twitter / X | 2010-11-04 01:42:54.657 | 1288834974657 | >> 22 |
Why JavaScript Needs BigInt for Snowflakes
A 64-bit Snowflake ID uses up to 19 decimal digits. Standard JavaScript numbers lose accuracy above 9007199254740991 (16 digits), which corrupts the last few digits of the ID and shifts worker bits. This tool uses BigInt arithmetic so every single bit stays accurate.
To extract a Discord creation timestamp in your own JavaScript code, shift the BigInt right by 22 bits and add the Discord epoch:
const snowflake = 175928847299117063n;
const discordEpoch = 1420070400000n;
const timestampMs = Number((snowflake >> 22n) + discordEpoch);
console.log(new Date(timestampMs).toISOString());