|
DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
|
Represents a time zone and handles time zone conversions. More...
#include <TimeZone.h>
Public Member Functions | |
| virtual DaylightTime | GetDaylightChanges (int year)=0 |
| Returns the daylight saving time period for a particular year. | |
| virtual String | GetDaylightName () const =0 |
| Gets the daylight saving time zone name. | |
| virtual String | GetStandardName () const =0 |
| Gets the standard time zone name. | |
| virtual TimeSpan | GetUtcOffset (const DateTimeOffset &time)=0 |
| Returns the Coordinated Universal Time (UTC) offset for the specified time. | |
| virtual bool | IsDaylightSavingTime (const DateTimeOffset &time) |
| Returns a value indicating whether the specified date and time is within a daylight saving time period. | |
| virtual DateTimeOffset | ToLocalTime (const DateTimeOffset &time) |
| Returns the local time that corresponds to a specified date and time value. | |
| virtual DateTimeOffset | ToUniversalTime (const DateTimeOffset &time) |
| Returns the Coordinated Universal Time (UTC) that corresponds to a specified time. | |
| 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 TimeZone * | GetCurrentTimeZone () |
| Gets the time zone of the current computer. | |
| static bool | IsDaylightSavingTime (const DateTimeOffset &time, const DaylightTime &daylightTimes) |
| Returns a value indicating whether the specified date and time is within the specified daylight saving time period. | |
| 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. | |
Represents a time zone and handles time zone conversions.
Modeled after .NET System.TimeZone. Supports querying standard and daylight names, daylight changes, UTC offset calculations, and UTC/local time conversions.
Definition at line 23 of file TimeZone.h.
|
static |
Gets the time zone of the current computer.
Retrieve singleton current time zone instance.
Definition at line 71 of file TimeZone.cpp.
Referenced by GetStandardName().
|
pure virtual |
Returns the daylight saving time period for a particular year.
| year | The year to evaluate. |
References DOTNETDUPE_API.
|
pure virtual |
Gets the daylight saving time zone name.
References DOTNETDUPE_API.
|
pure virtual |
Gets the standard time zone name.
References DOTNETDUPE_API, and GetCurrentTimeZone().
|
pure virtual |
Returns the Coordinated Universal Time (UTC) offset for the specified time.
| time | The point in time to evaluate. |
References DOTNETDUPE_API, IsDaylightSavingTime(), ToLocalTime(), and ToUniversalTime().
Referenced by ToLocalTime(), and ToUniversalTime().
|
virtual |
Returns a value indicating whether the specified date and time is within a daylight saving time period.
| time | The date and time to evaluate. |
Step: Check if current time falls within active daylight saving period.
Definition at line 77 of file TimeZone.cpp.
Referenced by GetUtcOffset().
|
static |
Returns a value indicating whether the specified date and time is within the specified daylight saving time period.
| time | A date and time value. |
| daylightTimes | A daylight saving time period. |
Guard: If delta is zero or start equals end, daylight saving is not active.
Check if time falls between daylight transition start and end bounds.
Definition at line 98 of file TimeZone.cpp.
References DotNetDupe::System::DaylightTime::GetDelta(), DotNetDupe::System::DaylightTime::GetEnd(), DotNetDupe::System::DaylightTime::GetStart(), and DotNetDupe::System::TimeSpan::GetTicks().
|
virtual |
Returns the local time that corresponds to a specified date and time value.
| time | A DateTimeOffset value. |
Step: Convert UTC time to local time by adding current UTC offset.
Definition at line 88 of file TimeZone.cpp.
References DotNetDupe::System::DateTimeOffset::DateTimeOffset(), DotNetDupe::System::DateTimeOffset::GetTicks(), and GetUtcOffset().
Referenced by GetUtcOffset().
|
virtual |
Returns the Coordinated Universal Time (UTC) that corresponds to a specified time.
| time | A DateTimeOffset value. |
Step: Convert local time to universal time by subtracting current UTC offset.
Definition at line 93 of file TimeZone.cpp.
References DotNetDupe::System::DateTimeOffset::DateTimeOffset(), DotNetDupe::System::DateTimeOffset::GetTicks(), and GetUtcOffset().
Referenced by GetUtcOffset().