public GeoTimezoneData(int geotzid, string tzid, string wintz) { TimezoneType = GeoTimezoneTypes.Olson; GeoTZID = geotzid; Key = Name = TZID = tzid; WinTZ = wintz; TimeZone = TimeZoneInfo.FindSystemTimeZoneById(wintz); DisplayAs = tzid.Replace("_", " "); OffsetUTC = OffsetDST = TimeZone.BaseUtcOffset; if (TimeZone.SupportsDaylightSavingTime) { OffsetDST.Add(new TimeSpan(1, 0, 0)); } }
// ================================================== // Constructors public GeoTimezoneData(int geotzid, string key, string tzid, string wintz) { TimezoneType = GeoTimezoneTypes.Windows; GeoTZID = geotzid; Key = key; TZID = tzid; Name = WinTZ = wintz; TimeZone = TimeZoneInfo.FindSystemTimeZoneById(wintz); DisplayAs = TimeZone.DisplayName; OffsetUTC = OffsetDST = TimeZone.BaseUtcOffset; if (TimeZone.SupportsDaylightSavingTime) { OffsetDST.Add(new TimeSpan(1, 0, 0)); } }