Skip to main content

tick_from_date

Function tick_from_date 

Source
pub fn tick_from_date(y: i64, m: u8, d: u8) -> Option<i128>
Expand description

Midnight tick of a calendar date on the SHARED tick axis, None on representable-range overflow (the tick must fit the i128 attosecond axis; values that fail here can never exist as parsed temporal terms anyway — the parser bounds are the representable bounds).

Subtracts [AXIS_ORIGIN_DAYS] so date / gYear / gYearMonth project onto the same origin an xsd:dateTime’s persisted tick already uses. Every calendar helper funnels through here, so the alignment holds for month starts, next-month starts, next-year starts, and both gYear interval edges.