From cf2673d4d4bc8d6b96f4488847d8c2b3c3545010 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Mon, 21 Mar 2022 22:00:30 -0400 Subject: Add seconds or nanoseconds to DateTime --- src/tai.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tai.rs') diff --git a/src/tai.rs b/src/tai.rs index 8dd91d2..015e70e 100644 --- a/src/tai.rs +++ b/src/tai.rs @@ -83,7 +83,7 @@ impl TimeZone for Tai { } // TODO optimize - fn offset_from_local_time(&self, date_time: NaiveDateTime) -> Result { + fn offset_from_local_naive(&self, date_time: NaiveDateTime) -> Result { // TAI times cannot have leap seconds if date_time.second() == 60 { return Err(UnexpectedLeapSecond { @@ -120,7 +120,7 @@ mod tests { #[test] fn test_conversion_no_leap_seconds() { let offset = unsafe { - Tai.offset_from_local_time(NaiveDateTime::new( + Tai.offset_from_local_naive(NaiveDateTime::new( Date::from_ymd_unchecked(2000.into(), Month::January, 1), Time::from_hms_unchecked(0, 0, 0), )) @@ -134,7 +134,7 @@ mod tests { fn test_conversion_one_leap_second() { add_leap_second(unsafe { Date::from_ymd_unchecked(2000.into(), Month::January, 1) }); let offset = unsafe { - Tai.offset_from_local_time(NaiveDateTime::new( + Tai.offset_from_local_naive(NaiveDateTime::new( Date::from_ymd_unchecked(2000.into(), Month::January, 2), Time::from_hms_unchecked(0, 0, 0), )) -- cgit v1.2.3