From bba54e1880bd70d634797052d78359e30ec79acd Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 12 May 2020 18:44:07 -0400 Subject: time_zone: Use std::chrono::seconds for strong typing. --- src/common/time_zone.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/time_zone.cpp') 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 -- cgit v1.2.3