/// Convert Unix time to Unix leap time, from the list of leap seconds in a time zone
Convert Unix time to Unix leap time, from the list of leap seconds in a time zone
Convert Unix time to Unix leap time from the list of leap seconds in a time zone
fn unix_time_to_unix_leap_time(&self, unix_time: i64) -> Result<i64, Error> {
        let mut unix_leap_time = unix_time;
        let mut i = 0;
        while i < self.leap_seconds.len() {
            let leap_second = &self.leap_seconds[i];
            if unix_leap_time < leap_second.unix_leap_time {
                break;
            }
            unix_leap_time = match unix_time.checked_add(leap_second.correction as i64) {
                Some(unix_leap_time) => unix_leap_time,
                None => return Err(Error::OutOfRange("out of range operation")),
            };
            i += 1;
        }
        Ok(unix_leap_time)
    }
fn unix_time_to_unix_leap_time ( & self , unix_time : i64 ) -> Result < i64 , Error > { let mut unix_leap_time = unix_time ; let mut i = 0 ; while i < self . leap_seconds . len ( ) { let leap_second = & self . leap_seconds [ i ] ; if unix_leap_time < leap_second . unix_leap_time { break ; } unix_leap_time = match unix_time . checked_add ( leap_second . correction as i64 ) { Some ( unix_leap_time ) => unix_leap_time , None => return Err ( Error :: OutOfRange ( " " ) ) , } ; i += 1 ; } Ok ( unix_leap_time ) }
Convert Unix time to Unix leap time, from the list of leap seconds in a time zone
Convert Unix time to Unix leap time from the list of leap seconds in a time zone
&self
unix_time
i64