diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/time_zone.cpp | 4 | ||||
-rw-r--r-- | src/common/time_zone.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/common/time_zone.cpp b/src/common/time_zone.cpp index b902d2d47..ce239eb63 100644 --- a/src/common/time_zone.cpp +++ b/src/common/time_zone.cpp @@ -37,13 +37,13 @@ static int ConvertOsTimeZoneOffsetToInt(const std::string& timezone) { } } -int GetCurrentOffsetSeconds() { +std::chrono::seconds GetCurrentOffsetSeconds() { const int offset{ConvertOsTimeZoneOffsetToInt(GetOsTimeZoneOffset())}; int seconds{(offset / 100) * 60 * 60}; // Convert hour component to seconds seconds += (offset % 100) * 60; // Convert minute component to seconds - return seconds; + return std::chrono::seconds{seconds}; } } // namespace Common::TimeZone diff --git a/src/common/time_zone.h b/src/common/time_zone.h index b7aa1bb10..945daa09c 100644 --- a/src/common/time_zone.h +++ b/src/common/time_zone.h @@ -4,6 +4,7 @@ #pragma once +#include <chrono> #include <string> namespace Common::TimeZone { @@ -12,6 +13,6 @@ namespace Common::TimeZone { std::string GetDefaultTimeZone(); /// Gets the offset of the current timezone (from the default), in seconds -int GetCurrentOffsetSeconds(); +std::chrono::seconds GetCurrentOffsetSeconds(); } // namespace Common::TimeZone |