extractTimestamp
import { extractTimestamp } from "jsr:@ende/uuid/v7";function
function extractTimestamp(uuid: string): numberExtracts the timestamp from a UUIDv7.
uuid: stringUUIDv7 string to extract the timestamp from.
Returns
Returns the timestamp in milliseconds.
Example: Usage
import { extractTimestamp } from "@ende/uuid/v7";
import { assertEquals } from "@ende/assert";
const uuid = "017f22e2-79b0-7cc3-98c4-dc0c0c07398f";
const timestamp = extractTimestamp(uuid);
assertEquals(timestamp, 1645557742000);