summaryrefslogtreecommitdiff
path: root/src/tai.rs
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2022-03-21 22:00:30 -0400
committerBotahamec <botahamec@outlook.com>2022-03-21 22:00:30 -0400
commitcf2673d4d4bc8d6b96f4488847d8c2b3c3545010 (patch)
treee9777ca24e0f2deda276e4d488e06a5ebeddb5fa /src/tai.rs
parent54d431b34edcc702ac88ec7d88d42487c12b17b4 (diff)
Add seconds or nanoseconds to DateTime
Diffstat (limited to 'src/tai.rs')
-rw-r--r--src/tai.rs6
1 files changed, 3 insertions, 3 deletions
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<UtcOffset, Self::Err> {
+ fn offset_from_local_naive(&self, date_time: NaiveDateTime) -> Result<UtcOffset, Self::Err> {
// 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),
))