Expand description
Date serial numbers.
The 1900 system counts days from 1899-12-31 (serial 1 = 1900-01-01) and, like Lotus 1-2-3 and Excel, treats 1900 as a leap year: serial 60 is the fictitious 1900-02-29. The 1904 system counts from 1904-01-01 (serial 0). Times are fractions of a day.
Structs§
- Date
Time - A calendar date and time of day.
Enums§
Constants§
Functions§
- civil_
from_ days - Proleptic Gregorian
(year, month, day)for a day countzsince 1970-01-01 (the inverse ofdays_from_civil). - datetime_
from_ serial - Date/time from a serial.
Nonefor negative or too-large serials. - days_
from_ civil - Days since 1970-01-01 for a proleptic Gregorian date, exact for every
i32year. - days_
in_ month - Number of days in month
mof yeary(1–31), or0for an invalid month number, for everyi32year. - days_
in_ month_ in - Days in a month of a date system’s calendar: like
days_in_month, except that February 1900 has 29 days in the 1900 system (serial 60 is the fictitious 1900-02-29). - is_leap
- Whether
yis a Gregorian leap year, for everyi32year. - max_
serial - Last serial that is a valid date in a date system: 9999-12-31 (2958465 in the 1900 system, 2957003 in the 1904 system).
- serial_
from_ unix_ ms - Date serial (1900 system, with fraction) for a Unix time in milliseconds.
- serial_
from_ ymd - Serial for a date. Month and day overflow roll over like
DATE()(month 13 = January next year, day 0 = last day of the previous month), in the date system’s own calendar: in the 1900 system February 1900 has 29 days, so(1900, 2, 29)and(1900, 3, 0)are serial 60.Nonebefore the epoch or after 9999-12-31. - serial_
in_ system - Converts a 1900-system serial (as the clock supplies it) to the serial of the same instant in
sys. - time_
fraction - Fraction of a day for a time.
- unix_
now_ ms - Milliseconds since the Unix epoch (UTC) from the system clock;
Nonewhen the clock is unavailable. Chrono uses the browser clock on wasm32, where the standard library clock methods trap.