time_zone.h 668 B

1234567891011121314151617181920212223
  1. // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <array>
  5. #include <chrono>
  6. #include <string>
  7. namespace Common::TimeZone {
  8. [[nodiscard]] const std::array<const char*, 46>& GetTimeZoneStrings();
  9. /// Gets the default timezone, i.e. "GMT"
  10. [[nodiscard]] std::string GetDefaultTimeZone();
  11. /// Gets the offset of the current timezone (from the default), in seconds
  12. [[nodiscard]] std::chrono::seconds GetCurrentOffsetSeconds();
  13. /// Searches time zone offsets for the closest offset to the system time zone
  14. [[nodiscard]] std::string FindSystemTimeZone();
  15. } // namespace Common::TimeZone