In one line
The lowest ID for a moment is (Unix ms − 1288834974657) shifted left by 22 bits; the highest in that millisecond adds 4,194,303 (all 22 lower bits set).
How do you turn a date into a post ID?
Subtract X's epoch from the Unix time in milliseconds and shift the result 22 bits to the left. That gives the smallest possible ID for that millisecond, with the machine and sequence bits all zero. Setting those 22 bits to one gives the largest.
| Moment (UTC) | Lowest ID | Highest ID |
|---|---|---|
| 2020-01-01 00:00:00.000 | 1212161512043446272 | 1212161512047640575 |
| 2025-01-01 00:00:00.000 | 1874244142494646272 | 1874244142498840575 |
Because the timestamp sits in the top bits, IDs grow with time. That's what makes ID ranges a stand-in for date ranges.
Where is this useful?
- API queries. X's search endpoints accept
since_idanduntil_idas well asstart_timeandend_time. If your tool or library only exposes the ID parameters, this converter gives you values to use. - Sorting exports. If a dataset has IDs but no dates, comparing against a boundary ID tells you which side of a date each post falls.
- Sanity checks. An ID that is larger than the upper boundary for "now" can't be a real post ID.
Is the conversion exact?
Yes, to the millisecond, in both directions. The "Check" line decodes both boundary IDs back to a time to show they round-trip. The time zone you choose only affects how you enter the moment; the IDs themselves are always based on UTC.
Questions people ask
Does a post with this ID exist?
Almost certainly not that exact number. The tool gives the boundaries of what X could have issued in that millisecond; real IDs fall between them only if a post was created then.
When would I use this?
When a tool or API filters by ID instead of by date. Anything with an ID greater than the 'lowest possible' value was created at or after your chosen moment.
Why can't I pick a date before November 2010?
There are no Snowflake IDs before X's epoch, 4 November 2010 at 01:42:54.657 UTC. Earlier posts used a different, sequential numbering.