DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
TimeZoneInfo.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include "Common.h"
9#include "System/Object.h"
10#include "System/String.h"
11#include "System/TimeSpan.h"
13#include <vector>
14
15namespace DotNetDupe {
16 namespace System {
17
23 class TimeZoneInfo : public Object {
24 public:
28
32
36
40
44
48
51 DOTNETDUPE_API static TimeZoneInfo Local();
52
55 DOTNETDUPE_API static TimeZoneInfo Utc();
56
60 DOTNETDUPE_API TimeSpan GetUtcOffset(const DateTimeOffset& dateTimeOffset) const;
61
65 DOTNETDUPE_API bool IsDaylightSavingTime(const DateTimeOffset& dateTimeOffset) const;
66
71 DOTNETDUPE_API static DateTimeOffset ConvertTime(const DateTimeOffset& dateTimeOffset, const TimeZoneInfo& destinationTimeZone);
72
74 DOTNETDUPE_API static DateTimeOffset ConvertTime(const DateTimeOffset& dateTimeOffset, const TimeZoneInfo& sourceTimeZone, const TimeZoneInfo& destinationTimeZone);
75
79 DOTNETDUPE_API static TimeZoneInfo FindSystemTimeZoneById(const String& id);
80
82 DOTNETDUPE_API bool Equals(const TimeZoneInfo& other) const;
83
84 private:
85 TimeZoneInfo(String id, TimeSpan baseUtcOffset, String displayName, String standardName, String daylightName, bool supportsDaylightSavingTime);
86
87 String _id;
88 TimeSpan _baseUtcOffset;
89 String _displayName;
90 String _standardName;
91 String _daylightName;
92 bool _supportsDaylightSavingTime;
93 };
94 }
95}
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Un...
Base object class for DotNetDupe mirroring .NET System.Object.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Represents a time interval.
Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Un...
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
Represents a time interval (duration of time or elapsed time) measured as a positive or negative numb...
Definition TimeSpan.h:20
bool IsDaylightSavingTime(const DateTimeOffset &dateTimeOffset) const
Indicates whether a specified date and time falls in the range of daylight saving time for the time z...
bool SupportsDaylightSavingTime() const
Gets a value that indicates whether the time zone has any daylight saving time rules.
TimeSpan GetBaseUtcOffset() const
Gets the time difference between the current time zone's standard time and Coordinated Universal Time...
bool Equals(const TimeZoneInfo &other) const
Determines whether the current TimeZoneInfo object and another TimeZoneInfo object are equal.
static TimeZoneInfo Utc()
Gets a TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone.
static TimeZoneInfo Local()
Gets a TimeZoneInfo object that represents the local time zone.
String GetDaylightName() const
Gets the display name for the time zone's daylight saving time.
String GetStandardName() const
Gets the display name for the time zone's standard time.
static DateTimeOffset ConvertTime(const DateTimeOffset &dateTimeOffset, const TimeZoneInfo &destinationTimeZone)
Converts a time to the time in another time zone.
String GetDisplayName() const
Gets the general display name that represents the time zone.
String GetId() const
Gets the time zone identifier.
TimeSpan GetUtcOffset(const DateTimeOffset &dateTimeOffset) const
Calculates the offset or difference between the time in this time zone and UTC for a particular point...
static TimeZoneInfo FindSystemTimeZoneById(const String &id)
Retrieves a TimeZoneInfo object from the registry or system database based on its identifier.