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 a3900f6 commit fb80b83Copy full SHA for fb80b83
src/input/datetime.rs
@@ -154,9 +154,12 @@ impl<'a> EitherTimedelta<'a> {
154
let microseconds: f64 = f64::from(py_timedelta.get_microseconds()); // 0 through 999999
155
Ok(86_400_000.0 * days + seconds * 1_000.0 + microseconds / 1_000.0)
156
}
157
- Self::PySubclass(py_timedelta) => py_timedelta
158
- .call_method0(intern!(py_timedelta.py(), "total_seconds"))?
159
- .extract(),
+ Self::PySubclass(py_timedelta) => {
+ let total_seconds = py_timedelta
+ .call_method0(intern!(py_timedelta.py(), "total_seconds"))?
160
+ .extract()?;
161
+ Ok(total_seconds / 1000.0)
162
+ },
163
164
165
0 commit comments