Table of Contents

Class TimeZoneRegionalDatabase

Namespace
Uncreated.Warfare.Steam
Assembly
Uncreated.Warfare.dll

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

logger ILogger<TimeZoneRegionalDatabase>
saveFile string
xmlDoc byte[]

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

logger ILogger<TimeZoneRegionalDatabase>
module WarfareModule

Fields

SourceUrl

public const string SourceUrl = "https://raw.githubusercontent.com/unicode-org/cldr/refs/heads/main/common/supplemental/windowsZones.xml"

Field Value

string

Properties

DefaultTimeZones

Dictionary of two-character territory codes to default time zones.

public IReadOnlyDictionary<string, TimeZoneInfo> DefaultTimeZones { get; }

Property Value

IReadOnlyDictionary<string, TimeZoneInfo>

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; }

Property Value

IReadOnlyDictionary<string, IReadOnlyList<TimeZoneInfo>>