Class TimeZoneInformation
- Namespace
- SWConfigDataSharedLib.Globalization
- Assembly
- IpPbxCDSSharedLib.dll
Information about a time zone
public class TimeZoneInformation
- Inheritance
-
TimeZoneInformation
Properties
Bias
The offset from UTC. Local = UTC + Bias.
public int Bias { get; }
Property Value
CurrentTimeZone
Get the currently selected time zone
public static TimeZoneInformation CurrentTimeZone { get; }
Property Value
CurrentTimeZonesDayLightName
Gets the day light saving name of the current timezone
public static string CurrentTimeZonesDayLightName { get; }
Property Value
CurrentTimeZonesStandardName
Gets the standard name of the current timezone. This name can be localized!
public static string CurrentTimeZonesStandardName { get; }
Property Value
DayLightDate
Gets the next beginning date of the current or next day light saving time period.
public DateTime DayLightDate { get; }
Property Value
DaylightBias
The offset from UTC during daylight time.
public int DaylightBias { get; }
Property Value
DaylightName
The zone's name during daylight savings time.
public string DaylightName { get; }
Property Value
DisplayName
The zone's display name, e.g. '(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London'.
public string DisplayName { get; }
Property Value
LastYearRule
public TimeZoneInfo.AdjustmentRule LastYearRule { get; }
Property Value
NExtYearRule
public TimeZoneInfo.AdjustmentRule NExtYearRule { get; }
Property Value
Name
The zone's name.
public string Name { get; }
Property Value
StandardBias
The offset from UTC during standard time.
public int StandardBias { get; }
Property Value
StandardDate
Gets the next beginning date of the current or next standard time period.
public DateTime StandardDate { get; }
Property Value
StandardName
The zone's name during 'standard' time (not daylight savings).
public string StandardName { get; }
Property Value
ThisYearRule
public TimeZoneInfo.AdjustmentRule ThisYearRule { get; }
Property Value
Methods
EnumZones()
Enumerate the available time zones
public static Dictionary<string, TimeZoneInformation> EnumZones()
Returns
- Dictionary<string, TimeZoneInformation>
The list of known time zones
FromStandardName(string)
Get a TimeZoneInformation for a supplied index.
public static TimeZoneInformation FromStandardName(string StandardName)
Parameters
StandardName
string
Returns
- TimeZoneInformation
The corresponding TimeZoneInformation.
Exceptions
- ArgumentOutOfRangeException
Thrown if the index is not found.
FromSystemTimeZoneID(string)
Get a TimeZoneInformation for a supplied index.
public static TimeZoneInformation FromSystemTimeZoneID(string SystemTimeZoneID)
Parameters
SystemTimeZoneID
stringThe time zone to find. The id is the standard name
Returns
- TimeZoneInformation
The corresponding TimeZoneInformation.
Exceptions
- ArgumentOutOfRangeException
Thrown if the index is not found.
FromUniversalTime(DateTime)
Convert a time interpreted as UTC to a time in this time zone.
public DateTime FromUniversalTime(DateTime utc)
Parameters
utc
DateTimeThe UTC time to convert.
Returns
- DateTime
The corresponding local time in this zone.
GetAllTimeZoneInformationSortedByBIAS()
Retrieves a list of all system time zones sort by bias.
public static TimeZoneInformation[] GetAllTimeZoneInformationSortedByBIAS()
Returns
- TimeZoneInformation[]
array of time zones
HasDayLightTime()
Retrieves if the time zone has a day light saving time.
public bool HasDayLightTime()
Returns
- bool
True is a day light saving time exists.
ToString()
Retrieves string representation of the time zone.
public override string ToString()
Returns
- string
String representation.
ToUniversalTime(DateTime)
Convert a time interpreted as a local time in this zone to the equivalent UTC. Note that there may be different possible interpretations at the daylight time boundaries.
public DateTime ToUniversalTime(DateTime local)
Parameters
local
DateTimeThe local time to convert.
Returns
- DateTime
The corresponding UTC.
Exceptions
- NotSupportedException
Thrown if the method failed due to missing platform support.