We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db5c9cf commit 2fed5b0Copy full SHA for 2fed5b0
gix-date/src/time/mod.rs
@@ -66,6 +66,7 @@ mod sign {
66
67
mod impls {
68
use crate::{time::Sign, Time};
69
+ use std::ops::Sub;
70
71
impl Default for Time {
72
fn default() -> Self {
@@ -76,4 +77,18 @@ mod impls {
76
77
}
78
79
80
+
81
+ impl Sub for Time {
82
+ type Output = i64;
83
84
+ fn sub(self, rhs: Self) -> Self::Output {
85
+ self.local_time() - rhs.local_time()
86
+ }
87
88
89
+ impl Time {
90
+ fn local_time(&self) -> i64 {
91
+ self.seconds + self.offset as i64
92
93
94
0 commit comments