Class TimeZoneRegionalDatabase
Maps territory/region codes to time zones.
public class TimeZoneRegionalDatabase : IHostedService
- Inheritance
-
TimeZoneRegionalDatabase
- Implements
- Inherited Members
Constructors
TimeZoneRegionalDatabase(ILogger<TimeZoneRegionalDatabase>, string?, byte[])
Load the time zone database from a byte array containing the windowsZones.xml file.
public TimeZoneRegionalDatabase(ILogger<TimeZoneRegionalDatabase> logger, string? saveFile, byte[] xmlDoc)
Parameters
loggerILogger<TimeZoneRegionalDatabase>saveFilestringxmlDocbyte[]
TimeZoneRegionalDatabase(ILogger<TimeZoneRegionalDatabase>, WarfareModule)
Load the time zone database from a the URL to the windowsZones.xml file. Only works in Unity.
public TimeZoneRegionalDatabase(ILogger<TimeZoneRegionalDatabase> logger, WarfareModule module)
Parameters
loggerILogger<TimeZoneRegionalDatabase>moduleWarfareModule
Fields
SourceUrl
public const string SourceUrl = "https://raw.githubusercontent.com/unicode-org/cldr/refs/heads/main/common/supplemental/windowsZones.xml"
Field Value
Properties
DefaultTimeZones
Dictionary of two-character territory codes to default time zones.
public IReadOnlyDictionary<string, TimeZoneInfo> DefaultTimeZones { get; }
Property Value
Remarks
Note that territories can have more than one time zone.
RegionTimeZones
Dictionary of two-character territory codes to all time zones the region overlaps with.
public IReadOnlyDictionary<string, IReadOnlyList<TimeZoneInfo>> RegionTimeZones { get; }