/// Subtract the provided duration from the timestamp.
Subtract the provided duration from the timestamp.
Subtract the provided duration from the timestamp .
fn sub(self, other: std::time::Duration) -> Timestamp {
    let other_sec: i64 = other.as_secs().try_into().unwrap();
    if other.subsec_nanos() > self.nanos {
      return Timestamp::new(
        self.seconds - other_sec - 1,
        self.nanos + 1_000_000_000 - other.subsec_nanos(),
      );
    }
    Timestamp::new(self.seconds - other_sec, self.nanos - other.subsec_nanos())
  }
fn sub ( self , other : std :: time :: Duration ) -> Timestamp { let other_sec : i64 = other . as_secs ( ) . try_into ( ) . unwrap ( ) ; if other . subsec_nanos ( ) > self . nanos { return Timestamp :: new ( self . seconds - other_sec - 1 , self . nanos + 1_000_000_000 - other . subsec_nanos ( ) , ) ; } Timestamp :: new ( self . seconds - other_sec , self . nanos - other . subsec_nanos ( ) ) }
Subtract the provided duration from the timestamp.
Subtract the provided duration from the timestamp .
self
other
std::time::Duration