time_zone: Use std::chrono::seconds for strong typing.
This commit is contained in:
parent
3c8cd62b0d
commit
bba54e1880
3 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue