Skip to main content

Module js_date

Module js_date 

Source
Expand description

The JavaScript Date operations chrono-node uses, emulated exactly.

chrono-node’s results depend on JS Date arithmetic: overflow in setDate/setMonth, the 0–99 year mapping of new Date(y, m, d), and so on. This type reproduces those rules on a millisecond time value.

The system time zone is always UTC. The golden data is recorded with TZ=UTC, so JS “local” getters and setters behave exactly like the UTC ones. A reference’s own time zone is handled separately by ReferenceWithTimezone, as upstream does.

Structs§

JsDate
A JS Date: a millisecond time value, or None for an invalid date (JS NaN). Deliberately not Ord: compare get_time() values, so NaN comparisons stay explicit.