TimeZone.h 674 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <AK/Optional.h>
  7. #include <AK/String.h>
  8. #include <AK/Time.h>
  9. #include <AK/Vector.h>
  10. #pragma once
  11. namespace Unicode {
  12. struct TimeZoneOffset {
  13. enum class InDST {
  14. No,
  15. Yes,
  16. };
  17. AK::Duration offset;
  18. InDST in_dst { InDST::No };
  19. };
  20. String current_time_zone();
  21. Vector<String> const& available_time_zones();
  22. Vector<String> available_time_zones_in_region(StringView region);
  23. Optional<String> resolve_primary_time_zone(StringView time_zone);
  24. Optional<TimeZoneOffset> time_zone_offset(StringView time_zone, UnixDateTime time);
  25. }