getTimestamp(
args: {lix: {call: (name:string,args?:unknown) =>Promise<unknown>; }; }):Promise<string>
Get the current timestamp as an ISO 8601 string.
In deterministic mode, returns logical timestamps starting from Unix epoch (1970-01-01T00:00:00.000Z), incrementing by 1ms per call. In normal mode, returns the current system time.
lix_deterministic_sequence_number.createdAt fields, TTL calculations, time-ordered queries.const lix = await openLix();
const ts = await timestamp({ lix }) // "2024-03-15T10:30:45.123Z"const lix = await openLix({ keyValues: [{ key: "lix_deterministic_mode", value: { enabled: true } }] });
await timestamp({ lix }) // "1970-01-01T00:00:00.000Z"
await timestamp({ lix }) // "1970-01-01T00:00:00.001Z"
await timestamp({ lix }) // "1970-01-01T00:00:00.002Z"| Parameter | Type |
|---|---|
args | { lix: { call: (name: string, args?: unknown) => Promise<unknown>; }; } |
args.lix | { call: (name: string, args?: unknown) => Promise<unknown>; } |
args.lix.call | (name: string, args?: unknown) => Promise<unknown> |
Promise<string>