Function rsfbclient_core::date_time::decode_date[][src]

pub fn decode_date(date: ISC_DATE) -> NaiveDate

Convert a numeric day to [day, month, year]. (Ported from the firebird source)

Calenders are divided into 4 year cycles: 3 non-leap years, and 1 leap year. Each cycle takes 365*4 + 1 == 1461 days. There is a further cycle of 100 4 year cycles. Every 100 years, the normally expected leap year is not present. Every 400 years it is. This cycle takes 100 * 1461 - 3 == 146097 days. The origin of the constant 2400001 is unknown. The origin of the constant 1721119 is unknown. The difference between 2400001 and 1721119 is the number of days from 0/0/0000 to our base date of 11/xx/1858 (678882) The origin of the constant 153 is unknown.

This whole routine has problems with ndates less than -678882 (Approx 2/1/0000).