summaryrefslogtreecommitdiff
path: root/src/common/time_zone.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2020-05-12 18:44:07 -0400
committerGravatar bunnei2020-05-12 18:44:07 -0400
commitbba54e1880bd70d634797052d78359e30ec79acd (patch)
tree27d598aa2ad461f0668702d59abb5d61b3ff5bd0 /src/common/time_zone.cpp
parenthle: service: time_zone_manager: Use current time zone setting. (diff)
downloadyuzu-bba54e1880bd70d634797052d78359e30ec79acd.tar.gz
yuzu-bba54e1880bd70d634797052d78359e30ec79acd.tar.xz
yuzu-bba54e1880bd70d634797052d78359e30ec79acd.zip
time_zone: Use std::chrono::seconds for strong typing.
Diffstat (limited to 'src/common/time_zone.cpp')
-rw-r--r--src/common/time_zone.cpp4
1 files changed, 2 insertions, 2 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) {
37 } 37 }
38} 38}
39 39
40int GetCurrentOffsetSeconds() { 40std::chrono::seconds GetCurrentOffsetSeconds() {
41 const int offset{ConvertOsTimeZoneOffsetToInt(GetOsTimeZoneOffset())}; 41 const int offset{ConvertOsTimeZoneOffsetToInt(GetOsTimeZoneOffset())};
42 42
43 int seconds{(offset / 100) * 60 * 60}; // Convert hour component to seconds 43 int seconds{(offset / 100) * 60 * 60}; // Convert hour component to seconds
44 seconds += (offset % 100) * 60; // Convert minute component to seconds 44 seconds += (offset % 100) * 60; // Convert minute component to seconds
45 45
46 return seconds; 46 return std::chrono::seconds{seconds};
47} 47}
48 48
49} // namespace Common::TimeZone 49} // namespace Common::TimeZone