DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System::TimeZoneInfo Class Reference

Represents any time zone in the world. More...

#include <TimeZoneInfo.h>

Inheritance diagram for DotNetDupe::System::TimeZoneInfo:

Public Member Functions

bool Equals (const TimeZoneInfo &other) const
 Determines whether the current TimeZoneInfo object and another TimeZoneInfo object are equal.
TimeSpan GetBaseUtcOffset () const
 Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).
String GetDaylightName () const
 Gets the display name for the time zone's daylight saving time.
String GetDisplayName () const
 Gets the general display name that represents the time zone.
String GetId () const
 Gets the time zone identifier.
String GetStandardName () const
 Gets the display name for the time zone's standard time.
TimeSpan GetUtcOffset (const DateTimeOffset &dateTimeOffset) const
 Calculates the offset or difference between the time in this time zone and UTC for a particular point in time.
bool IsDaylightSavingTime (const DateTimeOffset &dateTimeOffset) const
 Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current TimeZoneInfo object.
bool SupportsDaylightSavingTime () const
 Gets a value that indicates whether the time zone has any daylight saving time rules.
Public Member Functions inherited from DotNetDupe::System::Object
virtual ~Object ()=default
 Virtual destructor ensuring polymorphic cleanup.
virtual bool Equals (const Object &obj) const
 Determines whether the specified Object is equal to the current Object.
virtual int GetHashCode () const
 Serves as the default hash function.
bool operator== (const Object &obj) const
 Determines reference equality between two objects.
char * ToStringA () const
 Returns narrow-character string representation.
wchar_t * ToStringW () const
 Returns wide-character string representation.

Static Public Member Functions

static DateTimeOffset ConvertTime (const DateTimeOffset &dateTimeOffset, const TimeZoneInfo &destinationTimeZone)
 Converts a time to the time in another time zone.
static DateTimeOffset ConvertTime (const DateTimeOffset &dateTimeOffset, const TimeZoneInfo &sourceTimeZone, const TimeZoneInfo &destinationTimeZone)
 Converts a time to the time in another time zone based on source and destination time zones.
static TimeZoneInfo FindSystemTimeZoneById (const String &id)
 Retrieves a TimeZoneInfo object from the registry or system database based on its identifier.
static TimeZoneInfo Local ()
 Gets a TimeZoneInfo object that represents the local time zone.
static TimeZoneInfo Utc ()
 Gets a TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone.
Static Public Member Functions inherited from DotNetDupe::System::Object
static bool Equals (const Object &obj1, const Object &obj2)
 Static helper determining whether two object instances are equal.

Detailed Description

Represents any time zone in the world.

Note
Conforms to ECMA-335 Partition IV. Encapsulates UTC offset, display name, standard and daylight names, and daylight saving transition rules.

Definition at line 23 of file TimeZoneInfo.h.

Member Function Documentation

◆ ConvertTime() [1/2]

DateTimeOffset DotNetDupe::System::TimeZoneInfo::ConvertTime ( const DateTimeOffset & dateTimeOffset,
const TimeZoneInfo & destinationTimeZone )
static

Converts a time to the time in another time zone.

Parameters
dateTimeOffsetThe date and time to convert.
destinationTimeZoneThe time zone to convert dateTimeOffset to.
Returns
The date and time in the destination time zone.

Transform timestamp into destination time zone representation.

Definition at line 63 of file TimeZoneInfo.cpp.

References ConvertTime().

Referenced by ConvertTime(), and ConvertTime().

◆ ConvertTime() [2/2]

DateTimeOffset DotNetDupe::System::TimeZoneInfo::ConvertTime ( const DateTimeOffset & dateTimeOffset,
const TimeZoneInfo & sourceTimeZone,
const TimeZoneInfo & destinationTimeZone )
static

Converts a time to the time in another time zone based on source and destination time zones.

Transform timestamp from source to destination time zone.

Definition at line 68 of file TimeZoneInfo.cpp.

References ConvertTime().

◆ Equals()

bool DotNetDupe::System::TimeZoneInfo::Equals ( const TimeZoneInfo & other) const

Determines whether the current TimeZoneInfo object and another TimeZoneInfo object are equal.

Compare equivalence using canonical zone identifier.

Definition at line 79 of file TimeZoneInfo.cpp.

References Equals().

Referenced by Equals().

◆ FindSystemTimeZoneById()

TimeZoneInfo DotNetDupe::System::TimeZoneInfo::FindSystemTimeZoneById ( const String & id)
static

Retrieves a TimeZoneInfo object from the registry or system database based on its identifier.

Parameters
idThe time zone identifier.
Returns
An object whose identifier is the value of the id parameter.

Lookup system time zone database by key identifier.

Definition at line 73 of file TimeZoneInfo.cpp.

References FindSystemTimeZoneById(), and Utc().

Referenced by FindSystemTimeZoneById().

◆ GetBaseUtcOffset()

TimeSpan DotNetDupe::System::TimeZoneInfo::GetBaseUtcOffset ( ) const

Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).

Returns
An object that represents the time difference between the current time zone's standard time and UTC.

Definition at line 21 of file TimeZoneInfo.cpp.

References GetBaseUtcOffset().

Referenced by GetBaseUtcOffset().

◆ GetDaylightName()

String DotNetDupe::System::TimeZoneInfo::GetDaylightName ( ) const

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

Returns
The display name for the time zone's daylight saving time.

Definition at line 20 of file TimeZoneInfo.cpp.

References GetDaylightName().

Referenced by GetDaylightName().

◆ GetDisplayName()

String DotNetDupe::System::TimeZoneInfo::GetDisplayName ( ) const

Gets the general display name that represents the time zone.

Returns
The time zone's general display name.

Definition at line 18 of file TimeZoneInfo.cpp.

References GetDisplayName().

Referenced by GetDisplayName().

◆ GetId()

String DotNetDupe::System::TimeZoneInfo::GetId ( ) const

Gets the time zone identifier.

Returns
The time zone identifier.

Definition at line 17 of file TimeZoneInfo.cpp.

References GetId().

Referenced by GetId().

◆ GetStandardName()

String DotNetDupe::System::TimeZoneInfo::GetStandardName ( ) const

Gets the display name for the time zone's standard time.

Returns
The display name of the time zone's standard time.

Definition at line 19 of file TimeZoneInfo.cpp.

References GetStandardName().

Referenced by GetStandardName().

◆ GetUtcOffset()

TimeSpan DotNetDupe::System::TimeZoneInfo::GetUtcOffset ( const DateTimeOffset & dateTimeOffset) const

Calculates the offset or difference between the time in this time zone and UTC for a particular point in time.

Parameters
dateTimeOffsetThe date and time to determine the offset for.
Returns
An object that represents the time difference between the two time zones.

Compute effective UTC offset.

Definition at line 51 of file TimeZoneInfo.cpp.

References GetUtcOffset().

Referenced by GetUtcOffset().

◆ IsDaylightSavingTime()

bool DotNetDupe::System::TimeZoneInfo::IsDaylightSavingTime ( const DateTimeOffset & dateTimeOffset) const

Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current TimeZoneInfo object.

Parameters
dateTimeOffsetA date and time value.
Returns
true if the dateTimeOffset parameter is a daylight saving time; otherwise, false.

Check daylight saving activation for the given timestamp.

Definition at line 57 of file TimeZoneInfo.cpp.

References IsDaylightSavingTime().

Referenced by IsDaylightSavingTime().

◆ Local()

TimeZoneInfo DotNetDupe::System::TimeZoneInfo::Local ( )
static

Gets a TimeZoneInfo object that represents the local time zone.

Returns
An object that represents the local time zone.

Query dynamic time zone details from the Windows kernel.

Extract time zone key identifier, UTC bias, and standard/daylight names.

Return configured local time zone representation.

Definition at line 24 of file TimeZoneInfo.cpp.

References Local(), Utc(), and DotNetDupe::System::Internal::WCharToUtf8().

Referenced by Local().

◆ SupportsDaylightSavingTime()

bool DotNetDupe::System::TimeZoneInfo::SupportsDaylightSavingTime ( ) const

Gets a value that indicates whether the time zone has any daylight saving time rules.

Returns
true if the time zone supports daylight saving time; otherwise, false.

Definition at line 22 of file TimeZoneInfo.cpp.

References SupportsDaylightSavingTime().

Referenced by SupportsDaylightSavingTime().

◆ Utc()

TimeZoneInfo DotNetDupe::System::TimeZoneInfo::Utc ( )
static

Gets a TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone.

Returns
An object that represents the UTC zone.

Return static constant UTC representation with zero bias.

Definition at line 46 of file TimeZoneInfo.cpp.

References Utc().

Referenced by FindSystemTimeZoneById(), Local(), and Utc().


The documentation for this class was generated from the following files: