2024-06-24 14:17:32 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2024-09-03 15:20:20 +00:00
|
|
|
#pragma once
|
|
|
|
|
2024-06-25 15:06:08 +00:00
|
|
|
#include <AK/Optional.h>
|
2024-06-24 14:17:32 +00:00
|
|
|
#include <AK/String.h>
|
2024-06-25 19:27:20 +00:00
|
|
|
#include <AK/Time.h>
|
2024-06-25 15:06:08 +00:00
|
|
|
#include <AK/Vector.h>
|
2024-06-24 14:17:32 +00:00
|
|
|
|
|
|
|
namespace Unicode {
|
|
|
|
|
2024-06-25 19:27:20 +00:00
|
|
|
struct TimeZoneOffset {
|
|
|
|
enum class InDST {
|
|
|
|
No,
|
|
|
|
Yes,
|
|
|
|
};
|
|
|
|
|
2024-07-17 05:45:18 +00:00
|
|
|
AK::Duration offset;
|
2024-06-25 19:27:20 +00:00
|
|
|
InDST in_dst { InDST::No };
|
|
|
|
};
|
|
|
|
|
2024-08-26 14:20:24 +00:00
|
|
|
String current_time_zone();
|
2024-08-24 16:07:24 +00:00
|
|
|
void clear_system_time_zone_cache();
|
2024-06-25 15:06:08 +00:00
|
|
|
Vector<String> const& available_time_zones();
|
2024-06-25 15:33:26 +00:00
|
|
|
Vector<String> available_time_zones_in_region(StringView region);
|
2024-06-25 15:06:08 +00:00
|
|
|
Optional<String> resolve_primary_time_zone(StringView time_zone);
|
2024-06-25 19:27:20 +00:00
|
|
|
Optional<TimeZoneOffset> time_zone_offset(StringView time_zone, UnixDateTime time);
|
2024-06-24 14:17:32 +00:00
|
|
|
|
|
|
|
}
|