mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-29 03:01:21 -08:00
3979c7daa4
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.
24 lines
668 B
C++
24 lines
668 B
C++
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
#include <chrono>
|
|
#include <string>
|
|
|
|
namespace Common::TimeZone {
|
|
|
|
[[nodiscard]] const std::array<const char*, 46>& 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
|