Decoding a snowflake ID's hidden timestamp
Say a support ticket references a Discord message ID like 175928847299117063 — a number with no obvious date attached. Right-shifting that integer by 22 bits and adding Discord's custom epoch (1420070400000, itself a millisecond Unix timestamp for January 1, 2015) recovers the exact millisecond the message was created. Twitter/X snowflakes work the same way with a different fixed epoch (1288834974657).
Because the numbers involved exceed what JavaScript can safely handle as a regular Number, this kind of decoding needs BigInt arithmetic rather than plain floating-point math — a detail that trips up quick one-off scripts. A snowflake decoder mini-tool handles that bit-shifting and platform-epoch lookup for you: paste the ID, pick Discord or Twitter/X, and read off the creation date.
Why ISO week numbers matter
Suppose (hypothetically) a factory schedules production runs by week, or a finance team closes the books "by week 30" rather than by a specific date range — ISO week numbers avoid ambiguity that a plain "week of July 21" description can carry across different calendars and locales. Because ISO weeks don't line up cleanly with month boundaries, the first and last week of a year sometimes technically belongs to the adjacent calendar year, which is exactly the kind of edge case that's easy to get wrong by hand and worth letting a converter compute for you alongside the day-of-week and day-of-year breakdown.
Building SQL-ready date ranges
00:00:00) and end (23:59:59) of that period — not just the date itself. A date-range mini tool generates both values, in seconds and milliseconds, for local time or UTC.A query like WHERE created_at BETWEEN 1735689600 AND 1735775999 is far less error-prone to write than manually computing "midnight on this date" and "one second before midnight the next day" by hand, especially once a timezone or daylight-saving transition is involved. Picking a scope of day, month, or year and letting the tool emit both boundary epochs removes an entire category of off-by-one-day bugs from log filtering and reporting queries.
| Scope (example) | Start epoch (UTC) | End epoch (UTC) |
|---|---|---|
| Day: 2026-07-29 | 1785283200 | 1785369599 |
| Month: July 2026 | 1782892800 | 1785369599 |
Illustrative values for the day/month scope shown above; always regenerate the actual figures for your own timezone and date rather than reusing these.
What about UUIDv7 and ULID?
Snowflake IDs aren't the only identifier format with a timestamp baked in. UUIDv7, a newer UUID variant designed for database primary keys, stores a 48-bit millisecond Unix timestamp in its first six bytes so that UUIDs generated later sort after ones generated earlier — a property classic random UUIDv4 doesn't have. ULID (Universally Unique Lexicographically sortable Identifier) does something similar with a Crockford base32-encoded timestamp in its first 10 characters.
If you're debugging why rows in a UUIDv7-keyed table appear in a certain order, or trying to figure out roughly when a ULID-tagged record was created, you currently have to decode the bit layout (for UUIDv7) or the base32 encoding (for ULID) by hand or with a separate script. A dedicated UUIDv7 / ULID timestamp extractor mini-tool — paste the identifier, get back the embedded creation date-time — would be a natural companion to the existing snowflake decoder, since the underlying idea (timestamp bits embedded in a sortable ID) is the same even though the encoding differs. It's a reasonable feature to expect in a future update to this tool, alongside the epoch and snowflake conversions that already exist.
Convert epoch seconds/milliseconds to a date (or back), decode Discord/Twitter-X snowflake IDs, get ISO week numbers, and generate SQL-ready date ranges — all in your browser.
Try the free Unix Timestamp Converter →Frequently asked questions
How do I get the creation date out of a Discord or Twitter/X ID?
What is an ISO week number and why would I need one?
How do I get a start-of-day and end-of-day epoch for a SQL query?
WHERE created_at BETWEEN start AND end clause without manual date math.