API Reference / @evolu/common / Evolu/Internal / Millis

Variable: Millis

const Millis: BrandType<BrandType<Type<"Brand", number & Brand<"Int"> & Brand<"NonNegative">, number, NonNegativeError, number & Brand<"Int">, 
  | NumberError
  | IntError>, `LessThanOrEqualTo${number}`, LessThanOrEqualToError<number>, 
  | NumberError
  | NonNegativeError
  | IntError>, "Millis", BrandWithoutRefineError<"Millis", 
  | NumberError
  | NonNegativeError
  | IntError
| LessThanOrEqualToError<number>>, never>;

Defined in: packages/common/src/Evolu/Timestamp.ts:67

Millis is a timestamp in milliseconds, like Date.now(), but limited to the maximum value representable in 6 bytes (281474976710655) minus 1 (reserved for infinity). This enables more efficient binary serialization, saving 2 bytes compared to the typical 8-byte (64-bit) timestamp representation.

This limit is enforced to prevent data corruption. If a device's clock exceeds this range, Evolu will stop saving data until the clock is corrected.

new Date(281474976710654).toString() = Tue Aug 02 10889 07:31:49

Was this page helpful?