RFR: 8334015: Add Support for UUID Version 7 (UUIDv7) defined in RFC 9562 [v16]

Alan Bateman alanb at openjdk.org
Tue Sep 30 14:03:21 UTC 2025


On Tue, 30 Sep 2025 13:43:56 GMT, Brett Okken <duke at openjdk.org> wrote:

> Should the existing UUID.[timestamp](https://docs.oracle.com/en/java/javase/25/docs/api//java.base/java/util/UUID.html#timestamp())() be updated to also support v7 uuid? If not, should there be another, similar method to extract the timestamp from a v7 UUID?

The timestamp for a version 1 is in 100ns units from the start of the Gregorian calendar. Version 7 is millis since the Unix epoch in version 7. There is some back and forth on this when the PR was initially created. So while it may be confusing to use epochMillis and have timestamp throw UOE, it would be a hazard to do otherwise.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25303#issuecomment-3352327672


More information about the core-libs-dev mailing list