Skip to content

Commit fb80b83

Browse files
ollz272davidhewitt
andauthored
Update src/input/datetime.rs
Co-authored-by: David Hewitt <[email protected]>
1 parent a3900f6 commit fb80b83

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/input/datetime.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,12 @@ impl<'a> EitherTimedelta<'a> {
154154
let microseconds: f64 = f64::from(py_timedelta.get_microseconds()); // 0 through 999999
155155
Ok(86_400_000.0 * days + seconds * 1_000.0 + microseconds / 1_000.0)
156156
}
157-
Self::PySubclass(py_timedelta) => py_timedelta
158-
.call_method0(intern!(py_timedelta.py(), "total_seconds"))?
159-
.extract(),
157+
Self::PySubclass(py_timedelta) => {
158+
let total_seconds = py_timedelta
159+
.call_method0(intern!(py_timedelta.py(), "total_seconds"))?
160+
.extract()?;
161+
Ok(total_seconds / 1000.0)
162+
},
160163
}
161164
}
162165
}

0 commit comments

Comments
 (0)