Example: new Time(new Date()). Creates a point-in-time key from a Date or millisecond timestamp.
Example: time.begin(). Returns the inclusive start of the key in milliseconds since epoch.
Example: time.compare(otherTime). Compares this key to another key for ordering.
Example: time.contains(Date.now()). Returns true when this point fully contains the supplied temporal value.
Example: time.duration() // 0. Returns the temporal duration of the key in milliseconds.
Example: time.end(). Returns the inclusive end of the key in milliseconds since epoch.
Example: time.equals(otherTime). Returns true when the supplied key is the same Time.
Example: time.intersection(range). Returns the temporal intersection with the supplied value, if any.
Example: time.isAfter(otherTime). Returns true when this point begins strictly after the supplied temporal value ends.
Example: time.isBefore(otherTime). Returns true when this point ends strictly before the supplied temporal value begins.
Example: time.overlaps(range). Returns true when this point overlaps the supplied temporal value.
Example: time.timeRange(). Returns this point as a zero-width TimeRange.
Example: time.timestampMs(). Returns the key timestamp in milliseconds since epoch.
Example: time.toDate(). Returns a native Date for the key timestamp.
Example: time.trim(range). Returns this key when it falls within the supplied temporal value, otherwise undefined.
Example: time.type() // "time". Returns the key kind.
Example: Number(time). Returns the primitive millisecond timestamp for numeric coercion.
StaticparseExample: Time.parse("2025-01-01T09:00", { timeZone: "Europe/Madrid" }). Parses a strict ISO-like timestamp string into an absolute Time.
A point-in-time event key represented as a single millisecond timestamp. Example:
new Time(Date.now()).