Inherits System::IEquatable< TimeZoneInfoPtr >.

Classes

class  AdjustmentRule
 
class  TransitionTime
 RTTI information. More...
 

Public Types

typedef SharedPtr< AdjustmentRuleAdjustmentRulePtr
 An alias for a shared pointer to an instance of AdjustmentRule class. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Public Member Functions

ASPOSECPP_SHARED_API bool get_SupportsDaylightSavingTime () const
 Gets flag indicating if time zone has daylight saving time rules. More...
 
ASPOSECPP_SHARED_API TimeSpan get_BaseUtcOffset () const
 Returns an instance of TimeSpan that represents a time interval between the current time zone's standard time and UTC time. More...
 
ASPOSECPP_SHARED_API String get_DaylightName () const
 Gets name for the current time zone's daylight saving time. More...
 
ASPOSECPP_SHARED_API String get_StandardName () const
 Gets name for the current time zone's standart time. More...
 
ASPOSECPP_SHARED_API String get_DisplayName () const
 Gets name for the current time zone. More...
 
ASPOSECPP_SHARED_API String get_Id () const
 Returns the identifier of the time zone represented by the current object. More...
 
ASPOSECPP_SHARED_API ArrayPtr< AdjustmentRulePtrGetAdjustmentRules () const
 Returns an array consisting of AdjustmentRule objects that represent adjustment rules that apply to the current TimeZoneInfo object. More...
 
ASPOSECPP_SHARED_API ArrayPtr< TimeSpanGetAmbiguousTimeOffsets (DateTime date_time) const
 
ASPOSECPP_SHARED_API ArrayPtr< TimeSpanGetAmbiguousTimeOffsets (const DateTimeOffset &date_time_offset) const
 
ASPOSECPP_SHARED_API TimeSpan GetUtcOffset (DateTime date_time) const
 
TimeSpan GetUtcOffsetNoThrow (DateTime date_time) const
 
ASPOSECPP_SHARED_API TimeSpan GetUtcOffset (const DateTimeOffset &date_time_offset) const
 
ASPOSECPP_SHARED_API bool HasSameRules (const TimeZoneInfoPtr &other) const
 
ASPOSECPP_SHARED_API bool IsAmbiguousTime (DateTime date_time) const
 
ASPOSECPP_SHARED_API bool IsAmbiguousTime (const DateTimeOffset &date_time_offset) const
 
ASPOSECPP_SHARED_API bool IsDaylightSavingTime (DateTime date_time) const
 
ASPOSECPP_SHARED_API bool IsDaylightSavingTimeNoThrow (DateTime date_time) const
 
ASPOSECPP_SHARED_API bool IsDaylightSavingTime (const DateTimeOffset &date_time_offset) const
 
ASPOSECPP_SHARED_API bool IsInvalidTime (DateTime date_time) const
 
ASPOSECPP_SHARED_API bool Equals (SharedPtr< Object > obj) override
 
ASPOSECPP_SHARED_API bool Equals (TimeZoneInfoPtr other) override
 
ASPOSECPP_SHARED_API int GetHashCode () const override
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
ASPOSECPP_SHARED_API String ToString () const override
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Static Public Member Functions

static ASPOSECPP_SHARED_API TimeZoneInfoPtr get_Utc ()
 Returns an instance of TimeZoneInfo that represents a UTC time zone. More...
 
static ASPOSECPP_SHARED_API TimeZoneInfoPtr get_Local ()
 Returns an instance of TimeZoneInfo that represents a local time zone. More...
 
static ASPOSECPP_SHARED_API void ClearCachedData ()
 Clear cached time zone data. More...
 
static ASPOSECPP_SHARED_API DateTime ConvertTime (DateTime date_time, const TimeZoneInfoPtr &source_time_zone, const TimeZoneInfoPtr &destination_time_zone)
 
static ASPOSECPP_SHARED_API DateTimeOffset ConvertTime (const DateTimeOffset &date_time_offset, const TimeZoneInfoPtr &destination_time_zone)
 
static ASPOSECPP_SHARED_API DateTime ConvertTime (DateTime date_time, const TimeZoneInfoPtr &destination_time_zone)
 
static ASPOSECPP_SHARED_API DateTime ConvertTimeBySystemTimeZoneId (DateTime date_time, const String &destination_time_zone_id)
 
static ASPOSECPP_SHARED_API DateTimeOffset ConvertTimeBySystemTimeZoneId (const DateTimeOffset &date_time_offset, const String &destination_time_zone_id)
 
static ASPOSECPP_SHARED_API DateTime ConvertTimeBySystemTimeZoneId (DateTime date_time, const String &source_time_zone_id, const String &destination_time_zone_id)
 
static ASPOSECPP_SHARED_API DateTime ConvertTimeFromUtc (DateTime date_time, const TimeZoneInfoPtr &destination_time_zone)
 
static ASPOSECPP_SHARED_API DateTime ConvertTimeToUtc (DateTime date_time, const TimeZoneInfoPtr &source_time_zone)
 
static ASPOSECPP_SHARED_API DateTime ConvertTimeToUtc (DateTime date_time)
 
static DateTime ConvertTimeToUtcNoThrow (DateTime date_time)
 
static ASPOSECPP_SHARED_API TimeZoneInfoPtr CreateCustomTimeZone (const String &id, TimeSpan base_utc_offset, const String &display_name, const String &standard_display_name, const String &daylight_display_name, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules, bool disable_daylight_saving_time)
 
static ASPOSECPP_SHARED_API TimeZoneInfoPtr CreateCustomTimeZone (const String &id, TimeSpan base_utc_offset, const String &display_name, const String &standard_display_name, const String &daylight_display_name, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules)
 
static ASPOSECPP_SHARED_API TimeZoneInfoPtr CreateCustomTimeZone (const String &id, TimeSpan base_utc_offset, const String &display_name, const String &standard_display_name)
 
static ASPOSECPP_SHARED_API TimeZoneInfoPtr FindSystemTimeZoneById (const String &id)
 
static ASPOSECPP_SHARED_API SharedPtr< System::Collections::ObjectModel::ReadOnlyCollection< TimeZoneInfoPtr > > GetSystemTimeZones ()
 
static TimeSpan GetUtcOffsetFromUtc (DateTime time, const TimeZoneInfoPtr &zone)
 Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE. More...
 
static TimeSpan GetUtcOffsetFromUtc (DateTime time, const TimeZoneInfoPtr &zone, bool &is_daylight_savings, bool &is_ambiguous_local_dst)
 Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE. More...
 
static ASPOSECPP_SHARED_API DateTime TransitionTimeToDateTime (int32_t year, const TransitionTime &transitionTime)
 Helper function that converts a year and TransitionTime into a DateTime. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 

Protected Member Functions

ASPOSECPP_SHARED_API ~TimeZoneInfo () override
 Destructor. More...
 
 TimeZoneInfo (const String &id, TimeSpan base_utc_offset, const String &display_name, const String &standard_display_name, const String &daylight_display_name, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules, bool disable_daylight_saving_time, std::unique_ptr< const codeporting_icu::BasicTimeZone > &&icu_time_zone, DateTimeKind time_zone_kind=DateTimeKind::Unspecified)
 
 MEMBER_FUNCTION_MAKE_OBJECT (TimeZoneInfo, CODEPORTING_ARGS(const String &id, const TimeSpan &base_utc_offset, const String &display_name, const String &standard_display_name, const String &daylight_display_name, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules, bool disable_daylight_saving_time, std::unique_ptr< const codeporting_icu::BasicTimeZone > &&icu_time_zone, DateTimeKind time_zone_kind=DateTimeKind::Unspecified), CODEPORTING_ARGS(id, base_utc_offset, display_name, standard_display_name, daylight_display_name, adjustment_rules, disable_daylight_saving_time, std::forward< std::unique_ptr< const codeporting_icu::BasicTimeZone > &&>(icu_time_zone), time_zone_kind))
 
const ArrayPtr< AdjustmentRulePtr > & AdjustmentRules () const
 

Static Protected Member Functions

static DateTime ConvertTime (DateTime date_time, const TimeZoneInfoPtr &source_time_zone, const TimeZoneInfoPtr &destination_time_zone, bool throw_on_invalid_time)
 
static void VerifyTimeZoneInfo (const String &id, TimeSpan base_utc_offset, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules)
 Verify time zone information. More...
 
static TimeZoneInfoPtr CreateTimeZoneInfoFromIcuTimeZone (std::unique_ptr< const codeporting_icu::BasicTimeZone > &&time_zone, DateTimeKind time_zone_kind=DateTimeKind::Unspecified)
 

Protected Attributes

const String m_id
 The identifier of the time zone. More...
 
const String m_display_name
 The display name for the time zone. More...
 
const String m_standard_display_name
 The display name for the standard time of the time zone. More...
 
const String m_daylight_display_name
 The dispaly name for the daylight saving time of the time zone. More...
 
const TimeSpan m_base_utc_offset
 A time interval between the current time zone's standard time and UTC time. More...
 
const bool m_supports_daylight_saving_time
 Indicates whether the time zone represented by the current object assumes transition to daylight saving time. More...
 
System::Details::Lazy< ArrayPtr< AdjustmentRulePtr > > m_adjustment_rules
 Adjustment rules that apply to the current time zone. More...
 
const std::unique_ptr< const codeporting_icu::BasicTimeZone > m_icu_time_zone
 ICU Time zone. More...
 
const DateTimeKind m_time_zone_kind
 Time zone kind (UTC, Local or Unspecified). More...
 

Detailed Description

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.

Member Typedef Documentation

◆ AdjustmentRulePtr

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

Constructor & Destructor Documentation

◆ ~TimeZoneInfo()

ASPOSECPP_SHARED_API System::TimeZoneInfo::~TimeZoneInfo ( )
overrideprotected

Destructor.

◆ TimeZoneInfo()

System::TimeZoneInfo::TimeZoneInfo ( const String id,
TimeSpan  base_utc_offset,
const String display_name,
const String standard_display_name,
const String daylight_display_name,
const ArrayPtr< AdjustmentRulePtr > &  adjustment_rules,
bool  disable_daylight_saving_time,
std::unique_ptr< const codeporting_icu::BasicTimeZone > &&  icu_time_zone,
DateTimeKind  time_zone_kind = DateTimeKind::Unspecified 
)
protected

Constructs an instance of TimeZoneInfo.

Parameters
idThe identifier of the time zone represented by the object being constructed.
base_utc_offsetA time interval between the time zone's standard time and UTC time
display_nameThe display name for the time zone represented by the object being constructed.
standard_display_nameThe display name for the standard time of the time zone represented by the object being constructed.
daylight_display_nameThe dispaly name for the daylight saving time of the time zone reprsented by the object being constructed.
adjustment_rulesThe array containing the AdjustmentRule objects representing adjustment rules that apply to the time zone represented by the object being created.
disable_daylight_saving_timeSpecifies whether the time zone represented by the object being constructed assumes transition to daylight saving time.
icu_time_zoneICU Time zone.
time_zone_kindTime zone kind (UTC, Local or Unspecified).

Member Function Documentation

◆ AdjustmentRules()

const ArrayPtr<AdjustmentRulePtr>& System::TimeZoneInfo::AdjustmentRules ( ) const
protected

◆ ClearCachedData()

static ASPOSECPP_SHARED_API void System::TimeZoneInfo::ClearCachedData ( )
static

Clear cached time zone data.

◆ ConvertTime() [1/4]

static ASPOSECPP_SHARED_API DateTime System::TimeZoneInfo::ConvertTime ( DateTime  date_time,
const TimeZoneInfoPtr source_time_zone,
const TimeZoneInfoPtr destination_time_zone 
)
static

Convert time from one time zone to another.

Parameters
date_timeDate and time to convert.
source_time_zoneSource time zone.
destination_time_zoneDestination time zone.
Returns
Converted date and time.

◆ ConvertTime() [2/4]

static ASPOSECPP_SHARED_API DateTimeOffset System::TimeZoneInfo::ConvertTime ( const DateTimeOffset date_time_offset,
const TimeZoneInfoPtr destination_time_zone 
)
static

Convert time to the time in a specified time zone.

Parameters
date_time_offsetDate and time to convert.
destination_time_zoneDestination time zone.
Returns
Converted date and time.

◆ ConvertTime() [3/4]

static ASPOSECPP_SHARED_API DateTime System::TimeZoneInfo::ConvertTime ( DateTime  date_time,
const TimeZoneInfoPtr destination_time_zone 
)
static

Convert time to the time in a specified time zone.

Parameters
date_timeDate and time to convert.
destination_time_zoneDestination time zone.
Returns
Converted date and time.

◆ ConvertTime() [4/4]

static DateTime System::TimeZoneInfo::ConvertTime ( DateTime  date_time,
const TimeZoneInfoPtr source_time_zone,
const TimeZoneInfoPtr destination_time_zone,
bool  throw_on_invalid_time 
)
staticprotected

Convert time from one time zone to another.

Parameters
date_timeDate and time to convert.
source_time_zoneSource time zone.
destination_time_zoneDestination time zone.
throw_on_invalid_timeThrows exception in date_time is invalid.
Returns
Converted date and time.

◆ ConvertTimeBySystemTimeZoneId() [1/3]

static ASPOSECPP_SHARED_API DateTime System::TimeZoneInfo::ConvertTimeBySystemTimeZoneId ( DateTime  date_time,
const String destination_time_zone_id 
)
static

Convert time to the time in a specified time zone.

Parameters
date_timeDate and time to convert.
destination_time_zone_idIdentifier of the destination time zone.
Returns
Converted date and time.

◆ ConvertTimeBySystemTimeZoneId() [2/3]

static ASPOSECPP_SHARED_API DateTimeOffset System::TimeZoneInfo::ConvertTimeBySystemTimeZoneId ( const DateTimeOffset date_time_offset,
const String destination_time_zone_id 
)
static

Convert time to the time in a specified time zone.

Parameters
date_time_offsetDate and time to convert.
destination_time_zone_idIdentifier of the destination time zone.
Returns
Converted date and time.

◆ ConvertTimeBySystemTimeZoneId() [3/3]

static ASPOSECPP_SHARED_API DateTime System::TimeZoneInfo::ConvertTimeBySystemTimeZoneId ( DateTime  date_time,
const String source_time_zone_id,
const String destination_time_zone_id 
)
static

Convert time to the time in a specified time zone.

Parameters
date_timeDate and time to convert.
source_time_zone_idIdentifier of the source time zone.
destination_time_zone_idIdentifier of the destination time zone.
Returns
Converted date and time.

◆ ConvertTimeFromUtc()

static ASPOSECPP_SHARED_API DateTime System::TimeZoneInfo::ConvertTimeFromUtc ( DateTime  date_time,
const TimeZoneInfoPtr destination_time_zone 
)
static

Converts UTC-time to the time in a specified time zone.

Parameters
date_timeDate and time to convert.
destination_time_zoneDestination time zone.
Returns
Converted date and time.

◆ ConvertTimeToUtc() [1/2]

static ASPOSECPP_SHARED_API DateTime System::TimeZoneInfo::ConvertTimeToUtc ( DateTime  date_time,
const TimeZoneInfoPtr source_time_zone 
)
static

Converts time to UTC-time.

Parameters
date_timeDate and time to convert.
source_time_zoneSource time zone.
Returns
Converted date and time.

◆ ConvertTimeToUtc() [2/2]

static ASPOSECPP_SHARED_API DateTime System::TimeZoneInfo::ConvertTimeToUtc ( DateTime  date_time)
static

Converts time to UTC-time.

Parameters
date_timeDate and time to convert.
Returns
Converted date and time.

◆ ConvertTimeToUtcNoThrow()

static DateTime System::TimeZoneInfo::ConvertTimeToUtcNoThrow ( DateTime  date_time)
static

Converts time to UTC-time. FOR INTERNAL USE.

Parameters
date_timeDate and time to convert.
Returns
Converted date and time.

◆ CreateCustomTimeZone() [1/3]

static ASPOSECPP_SHARED_API TimeZoneInfoPtr System::TimeZoneInfo::CreateCustomTimeZone ( const String id,
TimeSpan  base_utc_offset,
const String display_name,
const String standard_display_name,
const String daylight_display_name,
const ArrayPtr< AdjustmentRulePtr > &  adjustment_rules,
bool  disable_daylight_saving_time 
)
static

Creates a custom time zone.

Parameters
idTime zone identifier.
base_utc_offsetTime interval between the current time zone's standard time and UTC time.
display_nameDisplay name.
standard_display_nameStandard time name.
daylight_display_nameDaylight saving time name.
adjustment_rulesArray of adjustment rules.
disable_daylight_saving_timeTrue to discard any daylight saving time information present in adjustment_rules.
Returns
New time zone.

◆ CreateCustomTimeZone() [2/3]

static ASPOSECPP_SHARED_API TimeZoneInfoPtr System::TimeZoneInfo::CreateCustomTimeZone ( const String id,
TimeSpan  base_utc_offset,
const String display_name,
const String standard_display_name,
const String daylight_display_name,
const ArrayPtr< AdjustmentRulePtr > &  adjustment_rules 
)
static

Creates a custom time zone.

Parameters
idTime zone identifier.
base_utc_offsetTime interval between the current time zone's standard time and UTC time.
display_nameDisplay name.
standard_display_nameStandard time name.
daylight_display_nameDaylight saving time name.
adjustment_rulesArray of adjustment rules.
Returns
New time zone.

◆ CreateCustomTimeZone() [3/3]

static ASPOSECPP_SHARED_API TimeZoneInfoPtr System::TimeZoneInfo::CreateCustomTimeZone ( const String id,
TimeSpan  base_utc_offset,
const String display_name,
const String standard_display_name 
)
static

Creates a custom time zone.

Parameters
idTime zone identifier.
base_utc_offsetTime interval between the current time zone's standard time and UTC time.
display_nameDisplay name.
standard_display_nameStandard time name.
Returns
New time zone.

◆ CreateTimeZoneInfoFromIcuTimeZone()

static TimeZoneInfoPtr System::TimeZoneInfo::CreateTimeZoneInfoFromIcuTimeZone ( std::unique_ptr< const codeporting_icu::BasicTimeZone > &&  time_zone,
DateTimeKind  time_zone_kind = DateTimeKind::Unspecified 
)
staticprotected

◆ Equals() [1/2]

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::Equals ( SharedPtr< Object obj)
override

◆ Equals() [2/2]

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::Equals ( TimeZoneInfoPtr  other)
overridevirtual

Determines if the the current and specified objects are equal.

Parameters
otherThe object to compare the current object with
Returns
True if the objects are equal, otherwise - false

Implements System::IEquatable< TimeZoneInfoPtr >.

◆ FindSystemTimeZoneById()

static ASPOSECPP_SHARED_API TimeZoneInfoPtr System::TimeZoneInfo::FindSystemTimeZoneById ( const String id)
static

Gets time zone with specified identifier.

Parameters
idTime zone identifier.
Returns
Time zone with specified identifier.

◆ get_BaseUtcOffset()

ASPOSECPP_SHARED_API TimeSpan System::TimeZoneInfo::get_BaseUtcOffset ( ) const

Returns an instance of TimeSpan that represents a time interval between the current time zone's standard time and UTC time.

◆ get_DaylightName()

ASPOSECPP_SHARED_API String System::TimeZoneInfo::get_DaylightName ( ) const

Gets name for the current time zone's daylight saving time.

◆ get_DisplayName()

ASPOSECPP_SHARED_API String System::TimeZoneInfo::get_DisplayName ( ) const

Gets name for the current time zone.

◆ get_Id()

ASPOSECPP_SHARED_API String System::TimeZoneInfo::get_Id ( ) const

Returns the identifier of the time zone represented by the current object.

◆ get_Local()

static ASPOSECPP_SHARED_API TimeZoneInfoPtr System::TimeZoneInfo::get_Local ( )
static

Returns an instance of TimeZoneInfo that represents a local time zone.

◆ get_StandardName()

ASPOSECPP_SHARED_API String System::TimeZoneInfo::get_StandardName ( ) const

Gets name for the current time zone's standart time.

◆ get_SupportsDaylightSavingTime()

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::get_SupportsDaylightSavingTime ( ) const

Gets flag indicating if time zone has daylight saving time rules.

◆ get_Utc()

static ASPOSECPP_SHARED_API TimeZoneInfoPtr System::TimeZoneInfo::get_Utc ( )
static

Returns an instance of TimeZoneInfo that represents a UTC time zone.

◆ GetAdjustmentRules()

ASPOSECPP_SHARED_API ArrayPtr<AdjustmentRulePtr> System::TimeZoneInfo::GetAdjustmentRules ( ) const

Returns an array consisting of AdjustmentRule objects that represent adjustment rules that apply to the current TimeZoneInfo object.

◆ GetAmbiguousTimeOffsets() [1/2]

ASPOSECPP_SHARED_API ArrayPtr<TimeSpan> System::TimeZoneInfo::GetAmbiguousTimeOffsets ( DateTime  date_time) const

Gets UTC dates and times that a specified date and time can be mapped to.

Parameters
date_timeDate and time.
Returns
Array of UTC dates and times.

◆ GetAmbiguousTimeOffsets() [2/2]

ASPOSECPP_SHARED_API ArrayPtr<TimeSpan> System::TimeZoneInfo::GetAmbiguousTimeOffsets ( const DateTimeOffset date_time_offset) const

Gets UTC dates and times that a specified date and time can be mapped to.

Parameters
date_time_offsetDate and time.
Returns
Array of UTC dates and times.

◆ GetHashCode()

ASPOSECPP_SHARED_API int System::TimeZoneInfo::GetHashCode ( ) const
overridevirtual

Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.

Returns
Hash code value as calculated by corresponding class.

Reimplemented from System::Object.

◆ GetSystemTimeZones()

static ASPOSECPP_SHARED_API SharedPtr<System::Collections::ObjectModel::ReadOnlyCollection<TimeZoneInfoPtr> > System::TimeZoneInfo::GetSystemTimeZones ( )
static

Gets sorted collection of all time zones available on the local system.

Returns
Collection of TimeZoneInfo objects.

◆ GetUtcOffset() [1/2]

ASPOSECPP_SHARED_API TimeSpan System::TimeZoneInfo::GetUtcOffset ( DateTime  date_time) const

Calculates difference between time in this time zone and UTC time zone for a specified date and time.

Parameters
date_timeDate and time.
Returns
Time difference between time zones.

◆ GetUtcOffset() [2/2]

ASPOSECPP_SHARED_API TimeSpan System::TimeZoneInfo::GetUtcOffset ( const DateTimeOffset date_time_offset) const

Calculates difference between time in this time zone and UTC time zone for a specified date and time.

Parameters
date_time_offsetDate and time.
Returns
Time difference between time zones.

◆ GetUtcOffsetFromUtc() [1/2]

static TimeSpan System::TimeZoneInfo::GetUtcOffsetFromUtc ( DateTime  time,
const TimeZoneInfoPtr zone 
)
static

Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE.

◆ GetUtcOffsetFromUtc() [2/2]

static TimeSpan System::TimeZoneInfo::GetUtcOffsetFromUtc ( DateTime  time,
const TimeZoneInfoPtr zone,
bool &  is_daylight_savings,
bool &  is_ambiguous_local_dst 
)
static

Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE.

◆ GetUtcOffsetNoThrow()

TimeSpan System::TimeZoneInfo::GetUtcOffsetNoThrow ( DateTime  date_time) const

Calculates difference between time in this time zone and UTC time zone for a specified date and time. FOR INTERNAL USE.

Parameters
date_timeDate and time.
Returns
Time difference between time zones.

◆ HasSameRules()

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::HasSameRules ( const TimeZoneInfoPtr other) const

Checks if current and another time zones have the same adjustment rules.

Parameters
otherTime zone info.
Returns
True if time zones have identical adjustment rules.

◆ IsAmbiguousTime() [1/2]

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::IsAmbiguousTime ( DateTime  date_time) const

Checks if specified date and time is ambiguous and can be mapped to many UTC times.

Parameters
date_timeDate and Time.
Returns
True if date_time is ambiguous.

◆ IsAmbiguousTime() [2/2]

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::IsAmbiguousTime ( const DateTimeOffset date_time_offset) const

Checks if specified date and time is ambiguous and can be mapped to many UTC times.

Parameters
date_time_offsetDate and Time.
Returns
True if date_time is ambiguous.

◆ IsDaylightSavingTime() [1/2]

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::IsDaylightSavingTime ( DateTime  date_time) const

Checks if specified date and time falls in range of daylight saving time.

Parameters
date_timeDate and Time.
Returns
True if date_time is a daylight saving time.

◆ IsDaylightSavingTime() [2/2]

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::IsDaylightSavingTime ( const DateTimeOffset date_time_offset) const

Checks if specified date and time falls in range of daylight saving time.

Parameters
date_time_offsetDate and Time.
Returns
True if date_time is a daylight saving time.

◆ IsDaylightSavingTimeNoThrow()

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::IsDaylightSavingTimeNoThrow ( DateTime  date_time) const

Checks if specified date and time falls in range of daylight saving time.

Parameters
date_timeDate and Time.
Returns
True if date_time is a daylight saving time.

◆ IsInvalidTime()

ASPOSECPP_SHARED_API bool System::TimeZoneInfo::IsInvalidTime ( DateTime  date_time) const

Checks if specified date and time is invalid.

Parameters
date_timeDate and Time.
Returns
True is date_time is invalid.

◆ MEMBER_FUNCTION_MAKE_OBJECT()

System::TimeZoneInfo::MEMBER_FUNCTION_MAKE_OBJECT ( TimeZoneInfo  ,
CODEPORTING_ARGS(const String &id, const TimeSpan &base_utc_offset, const String &display_name, const String &standard_display_name, const String &daylight_display_name, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules, bool disable_daylight_saving_time, std::unique_ptr< const codeporting_icu::BasicTimeZone > &&icu_time_zone, DateTimeKind time_zone_kind=DateTimeKind::Unspecified ,
CODEPORTING_ARGS(id, base_utc_offset, display_name, standard_display_name, daylight_display_name, adjustment_rules, disable_daylight_saving_time, std::forward< std::unique_ptr< const codeporting_icu::BasicTimeZone > && >(icu_time_zone), time_zone_kind)   
)
protected

◆ ToString()

ASPOSECPP_SHARED_API String System::TimeZoneInfo::ToString ( ) const
overridevirtual

Analog of C# Object.ToString() method. Enables converting custom objects to string.

Returns
String representation as provided by final class.

Reimplemented from System::Object.

◆ TransitionTimeToDateTime()

static ASPOSECPP_SHARED_API DateTime System::TimeZoneInfo::TransitionTimeToDateTime ( int32_t  year,
const TransitionTime transitionTime 
)
static

Helper function that converts a year and TransitionTime into a DateTime.

◆ VerifyTimeZoneInfo()

static void System::TimeZoneInfo::VerifyTimeZoneInfo ( const String id,
TimeSpan  base_utc_offset,
const ArrayPtr< AdjustmentRulePtr > &  adjustment_rules 
)
staticprotected

Verify time zone information.

Member Data Documentation

◆ m_adjustment_rules

System::Details::Lazy<ArrayPtr<AdjustmentRulePtr> > System::TimeZoneInfo::m_adjustment_rules
mutableprotected

Adjustment rules that apply to the current time zone.

◆ m_base_utc_offset

const TimeSpan System::TimeZoneInfo::m_base_utc_offset
protected

A time interval between the current time zone's standard time and UTC time.

◆ m_daylight_display_name

const String System::TimeZoneInfo::m_daylight_display_name
protected

The dispaly name for the daylight saving time of the time zone.

◆ m_display_name

const String System::TimeZoneInfo::m_display_name
protected

The display name for the time zone.

◆ m_icu_time_zone

const std::unique_ptr<const codeporting_icu::BasicTimeZone> System::TimeZoneInfo::m_icu_time_zone
protected

ICU Time zone.

◆ m_id

const String System::TimeZoneInfo::m_id
protected

The identifier of the time zone.

◆ m_standard_display_name

const String System::TimeZoneInfo::m_standard_display_name
protected

The display name for the standard time of the time zone.

◆ m_supports_daylight_saving_time

const bool System::TimeZoneInfo::m_supports_daylight_saving_time
protected

Indicates whether the time zone represented by the current object assumes transition to daylight saving time.

◆ m_time_zone_kind

const DateTimeKind System::TimeZoneInfo::m_time_zone_kind
protected

Time zone kind (UTC, Local or Unspecified).