4 ms·
UUIDv7 uses a 36-bit unsigned field to represent seconds since 1970-01-01 (and optionally other fields to enable sub-second precision). It doesn't overflow unt
by _kst_ 3y ago
UUIDv7 uses a 36-bit unsigned field to represent seconds since 1970-01-01 (and optionally other fields to enable sub-second precision).
It doesn't overflow until the year 4147 -- but since it's unsigned it can't represent times before 1970.
It's not designed to store times in the past, so that's not an issue for its intended use, but using it as a general time representation format could be problematic (say, if you want to represent a person's birth date).
(An aside: At a previous job, I worked on some code that would display a person's age given their stored birth date. The code didn't handle dates before 1900. I did a little research and found that that wouldn't be a problem, since everyone born before 1900 is dead. Ten years earlier, it would have been an issue.)