(&self)
| 91 | |
| 92 | impl ToGpsTime for DateTime<Utc> { |
| 93 | fn to_gps_time(&self) -> Duration { |
| 94 | let mut offset = Duration::zero(); |
| 95 | for ls in LEAP_SECONDS_TABLE.iter() { |
| 96 | if &ls.0 < self { |
| 97 | offset += ls.1; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | self.signed_duration_since(*GPS_EPOCH_TIME) + offset |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | impl ToDateTime for Duration { |