Timestamps by version

VersionTimestamp basisResolutionEpoch
v160-bit count of 100-ns intervals100 ns1582-10-15
v6Same as v1, reordered for sorting100 ns1582-10-15
v748-bit Unix milliseconds1 ms1970-01-01
ULID48-bit Unix milliseconds1 ms1970-01-01
v4None——

Decoding v1

A v1 UUID stores the timestamp in three non-contiguous groups: the low 32 bits in the first group, the middle 16 bits in the second, and the high 12 bits in the third. You must reassemble them before applying the 1582 epoch offset and dividing by 10,000 to get Unix seconds.

javascript
// time_low, time_mid, time_hi are the first three groups
const ticks = (time_hi << 48) | (time_mid << 32) | time_low;
const unixMs = (ticks / 10000) - 12219292800000; // 1582 -> 1970 offset in ms

Decoding v7 and ULID

For v7, the first 48 bits are already Unix milliseconds: take the first 12 hex digits, strip the hyphen, and parse as a number. For ULID, decode the first 10 Crockford base32 characters to the same 48-bit millisecond value.

A decoded timestamp is not proof of creation time. A caller can supply any UUID it likes; treat the decoded time as untrusted metadata unless the ID was generated by your system.