View source code
Display the source code in std/uuid.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aGitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.

Function std.uuid.UUID.v7Timestamp_method3

If the UUID is of version 7 it has a timestamp that this function returns as described in RFC 9562 (Method 3), otherwise an UUIDParsingException is thrown.

SysTime v7Timestamp_method3() const;

Example

Read UUID v7 Method 3 timestamp

import core.time;
import std.datetime;

const u = UUID("019913ce-f124-7835-96c7-a2df691caa98");
const ts = u.v7Timestamp_method3;
const toCmp = SysTime(DateTime(2025, 9, 4, 8, 19, 13), dur!"hnsecs"(3165129), UTC());

writeln(ts); // toCmp

Authors

Johannes Pfau

License

Boost License 1.0.