From 3979c7daa478199cff7bc985fceabcf30fadbc3b Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Tue, 23 May 2023 18:32:28 -0400 Subject: common: Move system time zone string detection Moves it from Settings to Common::TimeZone, since this algorithm doesn't depend on the setting. It also lets us use it in other libraries. common: Various fixes time_zone: Don't double up the std::abs Too many absolute values were causing mirrored time zones to resolve as the same. --- src/common/time_zone.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common/time_zone.h') diff --git a/src/common/time_zone.h b/src/common/time_zone.h index 99cae6ef2..f574d5c04 100644 --- a/src/common/time_zone.h +++ b/src/common/time_zone.h @@ -3,15 +3,21 @@ #pragma once +#include #include #include namespace Common::TimeZone { +[[nodiscard]] const std::array& GetTimeZoneStrings(); + /// Gets the default timezone, i.e. "GMT" [[nodiscard]] std::string GetDefaultTimeZone(); /// Gets the offset of the current timezone (from the default), in seconds [[nodiscard]] std::chrono::seconds GetCurrentOffsetSeconds(); +/// Searches time zone offsets for the closest offset to the system time zone +[[nodiscard]] std::string FindSystemTimeZone(); + } // namespace Common::TimeZone -- cgit v1.2.3