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 be85c20Copy full SHA for be85c20
gix-date/src/time/mod.rs
@@ -65,6 +65,7 @@ mod sign {
65
}
66
67
mod impls {
68
+ use std::ops::Sub;
69
use crate::{time::Sign, Time};
70
71
impl Default for Time {
@@ -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