Lines Matching +full:post +full:- +full:dates
1 // Copyright 2015-2016 Brian Smith.
24 ) -> Result<Time, Error> { in time_from_ymdhms_utc()
51 _ => unreachable!(), // `read_two_digits` already bounds-checked it. in time_from_ymdhms_utc()
55 days_before_year_since_unix_epoch + days_before_month_in_year + day_of_month - 1; in time_from_ymdhms_utc()
65 fn days_before_year_since_unix_epoch(year: u64) -> Result<u64, Error> { in days_before_year_since_unix_epoch()
66 // We don't support dates before January 1, 1970 because that is the in days_before_year_since_unix_epoch()
68 // certificates that have dates before the epoch. in days_before_year_since_unix_epoch()
74 Ok(days_before_year_ad - DAYS_BEFORE_UNIX_EPOCH_AD) in days_before_year_since_unix_epoch()
77 fn days_before_year_ad(year: u64) -> u64 { in days_before_year_ad()
78 ((year - 1) * 365) in days_before_year_ad()
79 + ((year - 1) / 4) // leap years are every 4 years, in days_before_year_ad()
80 - ((year - 1) / 100) // except years divisible by 100, in days_before_year_ad()
81 + ((year - 1) / 400) // except years divisible by 400. in days_before_year_ad()
84 pub fn days_in_month(year: u64, month: u64) -> u64 { in days_in_month()
89 _ => unreachable!(), // `read_two_digits` already bounds-checked it. in days_in_month()
93 fn days_in_feb(year: u64) -> u64 { in days_in_feb()
156 // leap year, post-feb in test_time_from_ymdhms_utc()