From a43e633d2bd19806a2fa4e1cec50a739fc8ccaf7 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 14 Sep 2023 08:34:04 +0200 Subject: [PATCH] chrono: fix aosn_date::from_system Signed-off-by: Simon Rozman --- include/stdex/chrono.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/stdex/chrono.hpp b/include/stdex/chrono.hpp index 77f32863c..617bcc1a3 100644 --- a/include/stdex/chrono.hpp +++ b/include/stdex/chrono.hpp @@ -76,7 +76,7 @@ namespace stdex { static time_point from_system(_In_ const FILETIME& t) noexcept { uint64_t x = ((static_cast(t.dwHighDateTime)) << 32) | t.dwLowDateTime; - return time_point(duration(static_cast(x / 86400000 + 2305814))); // Convert from 100 ns to 1-day interval and adjust epoch + return time_point(duration(static_cast(x / 864000000000 + 2305814))); // Convert from 100 ns to 1-day interval and adjust epoch } /// @@ -236,8 +236,8 @@ namespace stdex { /// static time_point from_system(_In_ const FILETIME& t) noexcept { - rep x = ((static_cast(t.dwHighDateTime)) << 32) | t.dwLowDateTime; - return time_point(duration(x / 10000 + 199222329600000)); // Convert from 100 ns to 1 ms interval and adjust epoch + uint64_t x = ((static_cast(t.dwHighDateTime)) << 32) | t.dwLowDateTime; + return time_point(duration(static_cast(x / 10000 + 199222329600000))); // Convert from 100 ns to 1 ms interval and adjust epoch } ///