uuid7_unix_ms#

scikitplot.corpus.uuid7_unix_ms(value)[source]#

Return the Unix time in milliseconds that a UUID version 7 carries.

Parameters:
valueuuid.UUID or str

A version-7 identifier, or its text form.

Returns:
int

The 48-bit unix_ts_ms field (RFC 9562, section 5.7).

Raises:
ValueError

If value is not a UUID, or not version 7 with the RFC 9562 variant.

TypeError

If value is neither a uuid.UUID nor a str.

Parameters:

value (UUID | str)

Return type:

int

Examples

The test vector of RFC 9562, appendix A.6 (2022-02-22 19:22:22 UTC):

>>> uuid7_unix_ms("017f22e2-79b0-7cc3-98c4-dc0c0c07398f")
1645557742000