Skip to main content

add_span

Function add_span 

Source
pub fn add_span(dt: CivilDateTime, months: i64, days: i64) -> CivilDateTime
Expand description

Add a calendar span (months then days) to a civil date-time — the civil (wall-clock) operation, distinct from adding a physical Duration. Months are applied first with end-of-month clamping (Jan 31 + 1 month = Feb 28/29), then whole days roll over exactly through the day number. The time-of-day is preserved. (Span arithmetic on a zoned value is where it diverges from a physical duration across a DST boundary; in UTC the two agree.)