summaryrefslogtreecommitdiff
path: root/src/time/FileTime.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/time/FileTime.hxx')
-rw-r--r--src/time/FileTime.hxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/time/FileTime.hxx b/src/time/FileTime.hxx
index 67fd5770b..a134433e3 100644
--- a/src/time/FileTime.hxx
+++ b/src/time/FileTime.hxx
@@ -47,10 +47,16 @@ ToUint64(FILETIME ft) noexcept
return ConstructUint64(ft.dwLowDateTime, ft.dwHighDateTime);
}
+constexpr int_least64_t
+ToInt64(FILETIME ft) noexcept
+{
+ return ToUint64(ft);
+}
+
constexpr time_t
FileTimeToTimeT(FILETIME ft) noexcept
{
- return (ToUint64(ft) - 116444736000000000) / 10000000;
+ return (ToInt64(ft) - 116444736000000000) / 10000000;
}
inline std::chrono::system_clock::time_point
@@ -63,7 +69,7 @@ FileTimeToChrono(FILETIME ft) noexcept
constexpr std::chrono::seconds
DeltaFileTimeS(FILETIME a, FILETIME b) noexcept
{
- return std::chrono::seconds((ToUint64(a) - ToUint64(b)) / 10000000);
+ return std::chrono::seconds((ToInt64(a) - ToInt64(b)) / 10000000);
}
#endif