Skip to main content

parse_date_to_days

Function parse_date_to_days 

Source
fn parse_date_to_days(string: &str) -> Option<i32>
Expand description

Parse a date string into days since 1970-01-01, covering the full Date32 range (years ≈ ±5,881,580) for the signed extended-year form.

The Gregorian calendar repeats exactly every 400 years (146,097 days), so we fold the year into [0, 400), validate the folded date, and add era * 146_097 to recover the absolute day count.

For all other inputs, behavior matches parse_date.