diff --git a/time/src/sys/local_offset_at/windows.rs b/time/src/sys/local_offset_at/windows.rs index f37551af7..d14429209 100644 --- a/time/src/sys/local_offset_at/windows.rs +++ b/time/src/sys/local_offset_at/windows.rs @@ -59,10 +59,9 @@ fn systemtime_to_filetime(systime: &SystemTime) -> Option { /// Convert a `FILETIME` to an `i64`, representing a number of seconds. fn filetime_to_secs(filetime: &FileTime) -> i64 { /// FILETIME represents 100-nanosecond intervals - const FT_TO_SECS: i64 = Nanosecond::per(Second) as i64 / 100; - (filetime.dwHighDateTime.cast_signed().extend::() << 32 - | filetime.dwLowDateTime.cast_signed().extend::()) - / FT_TO_SECS + const FT_TO_SECS: u64 = Nanosecond::per(Second) as u64 / 100; + ((filetime.dwHighDateTime.extend::() << 32 | filetime.dwLowDateTime.extend::()) + / FT_TO_SECS) as i64 } /// Convert an [`OffsetDateTime`] to a `SYSTEMTIME`.