System::TimeZoneInfo class

TimeZoneInfo class

Represents an information destribing a particular time zone. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class TimeZoneInfo : public System::IEquatable<TimeZoneInfoPtr>

Nested classes

Methods

MethodDescription
static ClearCachedData()Clear cached time zone data.
static ConvertTime(DateTime, const TimeZoneInfoPtr&, const TimeZoneInfoPtr&)Convert time from one time zone to another.
static ConvertTime(const DateTimeOffset&, const TimeZoneInfoPtr&)Convert time to the time in a specified time zone.
static ConvertTime(DateTime, const TimeZoneInfoPtr&)Convert time to the time in a specified time zone.
static ConvertTimeBySystemTimeZoneId(DateTime, const String&)Convert time to the time in a specified time zone.
static ConvertTimeBySystemTimeZoneId(const DateTimeOffset&, const String&)Convert time to the time in a specified time zone.
static ConvertTimeBySystemTimeZoneId(DateTime, const String&, const String&)Convert time to the time in a specified time zone.
static ConvertTimeFromUtc(DateTime, const TimeZoneInfoPtr&)Converts UTC-time to the time in a specified time zone.
static ConvertTimeToUtc(DateTime, const TimeZoneInfoPtr&)Converts time to UTC-time.
static ConvertTimeToUtc(DateTime)Converts time to UTC-time.
static ConvertTimeToUtcNoThrow(DateTime)Converts time to UTC-time. FOR INTERNAL USE.
static CreateCustomTimeZone(const String&, TimeSpan, const String&, const String&, const String&, const ArrayPtr<AdjustmentRulePtr>&, bool)Creates a custom time zone.
static CreateCustomTimeZone(const String&, TimeSpan, const String&, const String&, const String&, const ArrayPtr<AdjustmentRulePtr>&)Creates a custom time zone.
static CreateCustomTimeZone(const String&, TimeSpan, const String&, const String&)Creates a custom time zone.
Equals(SharedPtr<Object>) override
Equals(TimeZoneInfoPtr) overrideDetermines if the the current and specified objects are equal.
static FindSystemTimeZoneById(const String&)Gets time zone with specified identifier.
get_BaseUtcOffset() constReturns an instance of TimeSpan that represents a time interval between the current time zone’s standard time and UTC time.
get_DaylightName() constGets name for the current time zone’s daylight saving time.
get_DisplayName() constGets name for the current time zone.
get_Id() constReturns the identifier of the time zone represented by the current object.
static get_Local()Returns an instance of TimeZoneInfo that represents a local time zone.
get_StandardName() constGets name for the current time zone’s standart time.
get_SupportsDaylightSavingTime() constGets flag indicating if time zone has daylight saving time rules.
static get_Utc()Returns an instance of TimeZoneInfo that represents a UTC time zone.
GetAdjustmentRules() constReturns an array consisting of AdjustmentRule objects that represent adjustment rules that apply to the current TimeZoneInfo object.
GetAmbiguousTimeOffsets(DateTime) constGets UTC dates and times that a specified date and time can be mapped to.
GetAmbiguousTimeOffsets(const DateTimeOffset&) constGets UTC dates and times that a specified date and time can be mapped to.
GetHashCode() const overrideAnalog of C# Object.GetHashCode() method. Enables hashing of custom objects.
static GetSystemTimeZones()Gets sorted collection of all time zones available on the local system.
GetUtcOffset(DateTime) constCalculates difference between time in this time zone and UTC time zone for a specified date and time.
GetUtcOffset(const DateTimeOffset&) constCalculates difference between time in this time zone and UTC time zone for a specified date and time.
static GetUtcOffsetFromUtc(DateTime, const TimeZoneInfoPtr&)Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE.
static GetUtcOffsetFromUtc(DateTime, const TimeZoneInfoPtr&, bool&, bool&)Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE.
GetUtcOffsetNoThrow(DateTime) constCalculates difference between time in this time zone and UTC time zone for a specified date and time. FOR INTERNAL USE.
HasSameRules(const TimeZoneInfoPtr&) constChecks if current and another time zones have the same adjustment rules.
IsAmbiguousTime(DateTime) constChecks if specified date and time is ambiguous and can be mapped to many UTC times.
IsAmbiguousTime(const DateTimeOffset&) constChecks if specified date and time is ambiguous and can be mapped to many UTC times.
IsDaylightSavingTime(DateTime) constChecks if specified date and time falls in range of daylight saving time.
IsDaylightSavingTime(const DateTimeOffset&) constChecks if specified date and time falls in range of daylight saving time.
IsDaylightSavingTimeNoThrow(DateTime) constChecks if specified date and time falls in range of daylight saving time.
IsInvalidTime(DateTime) constChecks if specified date and time is invalid.
ToString() const overrideAnalog of C# Object.ToString() method. Enables converting custom objects to string.
static TransitionTimeToDateTime(int32_t, const TransitionTime&)Helper function that converts a year and TransitionTime into a DateTime.

Typedefs

TypedefDescription
AdjustmentRulePtrAn alias for a shared pointer to an instance of AdjustmentRule class.

See Also