1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:37:35 +00:00

LibTimeZone: Parse and generate a list of time zones used by region

The zone1970.tab file in the TZDB contains regional time zone data, some
of which we already parse for the system time zone settings map.

This parses the region names from that file and generates a list of time
zones which are used in each of those regions.
This commit is contained in:
Timothy Flynn 2022-07-05 15:56:23 -04:00 committed by Linus Groh
parent f6aa6a480c
commit fa005bd276
4 changed files with 65 additions and 2 deletions

View file

@ -13,6 +13,7 @@
#include <AK/StringView.h>
#include <AK/Time.h>
#include <AK/Types.h>
#include <AK/Vector.h>
#include <LibTimeZone/Forward.h>
namespace TimeZone {
@ -68,4 +69,8 @@ Optional<Array<NamedOffset, 2>> get_named_time_zone_offsets(StringView time_zone
Optional<Location> get_time_zone_location(TimeZone time_zone);
Optional<Location> get_time_zone_location(StringView time_zone);
Optional<Region> region_from_string(StringView region);
StringView region_to_string(Region region);
Vector<StringView> time_zones_in_region(StringView region);
}