Public Member Functions

constexpr DateTimeOffset ()=default
 Default constructor. More...
 
ASPOSECPP_SHARED_API DateTimeOffset (DateTime date_time)
 
ASPOSECPP_SHARED_API DateTimeOffset (int64_t ticks, TimeSpan offset)
 
ASPOSECPP_SHARED_API DateTimeOffset (DateTime date_time, TimeSpan offset)
 
ASPOSECPP_SHARED_API DateTimeOffset (int year, int month, int day, int hour, int minute, int second, TimeSpan offset)
 
ASPOSECPP_SHARED_API DateTimeOffset (int year, int month, int day, int hour, int minute, int second, int millisecond, TimeSpan offset)
 
ASPOSECPP_SHARED_API DateTimeOffset (int year, int month, int day, int hour, int minute, int second, int millisecond, const SharedPtr< Globalization::Calendar > &calendar, TimeSpan offset)
 
ASPOSECPP_SHARED_API DateTime get_DateTime () const
 Gets DateTime value. More...
 
ASPOSECPP_SHARED_API DateTime get_UtcDateTime () const
 Gets DateTime value that represents the UTC date and time. More...
 
ASPOSECPP_SHARED_API DateTime get_LocalDateTime () const
 Gets DateTime value that represents the local date and time. More...
 
ASPOSECPP_SHARED_API DateTime get_Date () const
 Gets date component of the current object. More...
 
ASPOSECPP_SHARED_API int get_Year () const
 Gets year component of the current object. More...
 
ASPOSECPP_SHARED_API int get_Month () const
 Gets month component of the current object. More...
 
ASPOSECPP_SHARED_API int get_Day () const
 Gets day of the month of the current object. More...
 
ASPOSECPP_SHARED_API DayOfWeek get_DayOfWeek () const
 Gets day of the week of the current object. More...
 
ASPOSECPP_SHARED_API int get_DayOfYear () const
 Gets day of year of the current object. More...
 
ASPOSECPP_SHARED_API int get_Hour () const
 Gets hour component of the current object. More...
 
ASPOSECPP_SHARED_API int get_Minute () const
 Gets minute component of the current object. More...
 
constexpr int get_Second () const
 Gets second component of the current object. More...
 
constexpr int get_Millisecond () const
 Gets millisecond component of the current object. More...
 
constexpr TimeSpan get_Offset () const
 Gets offset from UTC. More...
 
ASPOSECPP_SHARED_API int64_t get_Ticks () const
 Gets number of ticks of the current object. More...
 
ASPOSECPP_SHARED_API int64_t get_UtcTicks () const
 Gets number of ticks of the current object in UTC time. More...
 
ASPOSECPP_SHARED_API TimeSpan get_TimeOfDay () const
 Gets time of day of the current object. More...
 
ASPOSECPP_SHARED_API DateTimeOffset Add (TimeSpan value) const
 
ASPOSECPP_SHARED_API DateTimeOffset AddYears (int years) const
 
ASPOSECPP_SHARED_API DateTimeOffset AddMonths (int months) const
 
ASPOSECPP_SHARED_API DateTimeOffset AddDays (double days) const
 
ASPOSECPP_SHARED_API DateTimeOffset AddHours (double hours) const
 
ASPOSECPP_SHARED_API DateTimeOffset AddMinutes (double minutes) const
 
ASPOSECPP_SHARED_API DateTimeOffset AddSeconds (double seconds) const
 
ASPOSECPP_SHARED_API DateTimeOffset AddMilliseconds (double milliseconds) const
 
ASPOSECPP_SHARED_API DateTimeOffset AddTicks (int64_t ticks) const
 
ASPOSECPP_SHARED_API int CompareTo (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API int CompareTo (const SharedPtr< Object > &obj) const
 
ASPOSECPP_SHARED_API bool Equals (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API bool Equals (const SharedPtr< Object > &obj) const
 
ASPOSECPP_SHARED_API bool EqualsExact (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API bool EqualsExact (const SharedPtr< Object > &obj) const
 
ASPOSECPP_SHARED_API DateTimeOffset Subtract (TimeSpan value) const
 
ASPOSECPP_SHARED_API TimeSpan Subtract (const DateTimeOffset &value) const
 
ASPOSECPP_SHARED_API int64_t ToFileTime () const
 
ASPOSECPP_SHARED_API DateTimeOffset ToLocalTime () const
 
ASPOSECPP_SHARED_API DateTimeOffset ToOffset (TimeSpan offset) const
 
ASPOSECPP_SHARED_API String ToString (const String &format, const SharedPtr< IFormatProvider > &provider) const
 
ASPOSECPP_SHARED_API String ToString (const SharedPtr< IFormatProvider > &provider) const
 
ASPOSECPP_SHARED_API String ToString (const String &format) const
 
ASPOSECPP_SHARED_API DateTimeOffset ToUniversalTime () const
 
ASPOSECPP_SHARED_API int64_t ToUnixTimeMilliseconds () const
 
ASPOSECPP_SHARED_API int64_t ToUnixTimeSeconds () const
 
ASPOSECPP_SHARED_API int GetHashCode () const
 
ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API DateTimeOffset operator+ (TimeSpan value) const
 
ASPOSECPP_SHARED_API DateTimeOffset operator- (TimeSpan value) const
 
ASPOSECPP_SHARED_API TimeSpan operator- (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API bool operator== (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API bool operator!= (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API bool operator< (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API bool operator> (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API bool operator<= (const DateTimeOffset &other) const
 
ASPOSECPP_SHARED_API bool operator>= (const DateTimeOffset &other) const
 
constexpr bool IsNull () const
 
constexpr bool operator== (std::nullptr_t) const
 
constexpr bool operator!= (std::nullptr_t) const
 
constexpr bool operator< (std::nullptr_t) const
 
constexpr bool operator<= (std::nullptr_t) const
 
constexpr bool operator> (std::nullptr_t) const
 
constexpr bool operator>= (std::nullptr_t) const
 

Static Public Member Functions

static ASPOSECPP_SHARED_API DateTimeOffset get_UtcNow ()
 Gets DateTimeOffset whose date and time are set to the current UTC-time and whose offset is TimeSpan::Zero. More...
 
static ASPOSECPP_SHARED_API DateTimeOffset get_Now ()
 Gets DateTimeOffset whose date and time are set to the current local-time and whose offset is set to local time's offset. More...
 
static ASPOSECPP_SHARED_API int Compare (const DateTimeOffset &first, const DateTimeOffset &second)
 
static ASPOSECPP_SHARED_API bool Equals (const DateTimeOffset &first, const DateTimeOffset &second)
 
static ASPOSECPP_SHARED_API DateTimeOffset FromFileTime (int64_t file_time)
 
static ASPOSECPP_SHARED_API DateTimeOffset FromUnixTimeMilliseconds (int64_t milliseconds)
 
static ASPOSECPP_SHARED_API DateTimeOffset FromUnixTimeSeconds (int64_t seconds)
 
static ASPOSECPP_SHARED_API DateTimeOffset Parse (const String &input)
 
static ASPOSECPP_SHARED_API DateTimeOffset Parse (const String &input, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None)
 
static ASPOSECPP_SHARED_API DateTimeOffset ParseExact (const String &input, const String &format, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None)
 
static ASPOSECPP_SHARED_API DateTimeOffset ParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles)
 
static ASPOSECPP_SHARED_API bool TryParse (const String &input, DateTimeOffset &result)
 
static ASPOSECPP_SHARED_API bool TryParse (const String &input, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTimeOffset &result)
 
static ASPOSECPP_SHARED_API bool TryParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTimeOffset &result)
 
static ASPOSECPP_SHARED_API bool TryParseExact (const String &input, const String &format, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTimeOffset &result)
 
static const TypeInfoType ()
 Returns a TypeInfo object that represent TimeSpan structure. More...
 

Static Public Attributes

static constexpr int64_t MaxOffset = TimeSpan::TicksPerHour * 14
 Gets maximum offset in ticks. More...
 
static constexpr int64_t MinOffset = -MaxOffset
 Gets minimum offset in ticks. More...
 
static ASPOSECPP_SHARED_API const DateTimeOffset MinValue
 Gets earliest DateTimeOffset value. More...
 
static ASPOSECPP_SHARED_API const DateTimeOffset MaxValue
 Gets greatest DateTimeOffset value. More...
 
static ASPOSECPP_SHARED_API const DateTimeOffset UnixEpoch
 Gets Unix epoch start. More...
 

Detailed Description

Contains the date and time of day relative to Coordinated Universal Time. 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.

Constructor & Destructor Documentation

◆ DateTimeOffset() [1/7]

constexpr System::DateTimeOffset::DateTimeOffset ( )
default

Default constructor.

◆ DateTimeOffset() [2/7]

ASPOSECPP_SHARED_API System::DateTimeOffset::DateTimeOffset ( DateTime  date_time)

Constructor.

Parameters
date_timeDate and time.

◆ DateTimeOffset() [3/7]

ASPOSECPP_SHARED_API System::DateTimeOffset::DateTimeOffset ( int64_t  ticks,
TimeSpan  offset 
)

Constructor.

Parameters
ticksNumber of ticks.
offsetTime offset from UTC.

◆ DateTimeOffset() [4/7]

ASPOSECPP_SHARED_API System::DateTimeOffset::DateTimeOffset ( DateTime  date_time,
TimeSpan  offset 
)

Constructor.

Parameters
date_timeDate and time.
offsetTime offset from UTC.

◆ DateTimeOffset() [5/7]

ASPOSECPP_SHARED_API System::DateTimeOffset::DateTimeOffset ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
TimeSpan  offset 
)

Constructor.

Parameters
yearYear (1 through 9999).
monthMonth (1 through 12).
dayDay (1 through the number of days in month).
hourHour (0 through 23).
minuteMinute (0 through 59).
secondSecond (0 through 59).
offsetTime offset from UTC.

◆ DateTimeOffset() [6/7]

ASPOSECPP_SHARED_API System::DateTimeOffset::DateTimeOffset ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
int  millisecond,
TimeSpan  offset 
)

Constructor.

Parameters
yearYear (1 through 9999).
monthMonth (1 through 12).
dayDay (1 through the number of days in month).
hourHour (0 through 23).
minuteMinute (0 through 59).
secondSecond (0 through 59).
millisecondMillisecond (0 through 999).
offsetTime offset from UTC.

◆ DateTimeOffset() [7/7]

ASPOSECPP_SHARED_API System::DateTimeOffset::DateTimeOffset ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
int  millisecond,
const SharedPtr< Globalization::Calendar > &  calendar,
TimeSpan  offset 
)

Constructor.

Parameters
yearYear.
monthMonth (1 through 12).
dayDay (1 through the number of days in month).
hourHour (0 through 23).
minuteMinute (0 through 59).
secondSecond (0 through 59).
millisecondMillisecond (0 through 999).
calendarCalendar used to interpret year, month, and day.
offsetTime offset from UTC.

Member Function Documentation

◆ Add()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::Add ( TimeSpan  value) const

Adds a specified time interval to the DateTimeOffset object.

Parameters
valuePositive or a negative time interval.
Returns
Result of operation.

◆ AddDays()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::AddDays ( double  days) const

Adds a specified number of days to the DateTimeOffset object.

Parameters
daysPositive or negative number of days.
Returns
Result of operation.

◆ AddHours()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::AddHours ( double  hours) const

Adds a specified number of hours to the DateTimeOffset object.

Parameters
hoursPositive or negative number of hours.
Returns
Result of operation.

◆ AddMilliseconds()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::AddMilliseconds ( double  milliseconds) const

Adds a specified number of milliseconds to the DateTimeOffset object.

Parameters
millisecondsPositive or negative number of milliseconds.
Returns
Result of operation.

◆ AddMinutes()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::AddMinutes ( double  minutes) const

Adds a specified number of minutes to the DateTimeOffset object.

Parameters
minutesPositive or negative number of minutes.
Returns
Result of operation.

◆ AddMonths()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::AddMonths ( int  months) const

Adds a specified number of months to the DateTimeOffset object.

Parameters
monthsPositive or negative number of months.
Returns
Result of operation.

◆ AddSeconds()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::AddSeconds ( double  seconds) const

Adds a specified number of seconds to the DateTimeOffset object.

Parameters
secondsPositive or negative number of seconds.
Returns
Result of operation.

◆ AddTicks()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::AddTicks ( int64_t  ticks) const

Adds a specified number of ticks to the DateTimeOffset object.

Parameters
ticksPositive or negative number of ticks.
Returns
Result of operation.

◆ AddYears()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::AddYears ( int  years) const

Adds a specified number of years to the DateTimeOffset object.

Parameters
yearsPositive or negative number of years.
Returns
Result of operation.

◆ Compare()

static ASPOSECPP_SHARED_API int System::DateTimeOffset::Compare ( const DateTimeOffset first,
const DateTimeOffset second 
)
static

Compares two DateTimeOffset objects.

Parameters
firstFirst object to compare.
secondSecond object to compare.
Returns
-1 - if first is earlier than second, 1 - if first is later than second, 0 - if first is equal to second.

◆ CompareTo() [1/2]

ASPOSECPP_SHARED_API int System::DateTimeOffset::CompareTo ( const DateTimeOffset other) const

Compares two DateTimeOffset objects.

Parameters
otherObject to compare.
Returns
-1 - if current object is earlier than other, 1 - if current object is later than other, 0 - if current object is equal to other.

◆ CompareTo() [2/2]

ASPOSECPP_SHARED_API int System::DateTimeOffset::CompareTo ( const SharedPtr< Object > &  obj) const

Compares two DateTimeOffset objects.

Parameters
objObject to compare.
Returns
-1 - if current object is earlier than obj, 1 - if current object is later than obj, 0 - if current object is equal to obj.

◆ Equals() [1/3]

static ASPOSECPP_SHARED_API bool System::DateTimeOffset::Equals ( const DateTimeOffset first,
const DateTimeOffset second 
)
static

Checks if two DateTimeOffset objects represent the same time point.

Parameters
firstFirst object to compare.
secondSecond object to compare.
Returns
true if first is equal to second, otherwise - false.

◆ Equals() [2/3]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::Equals ( const DateTimeOffset other) const

Checks if two DateTimeOffset objects represents the same time point.

Parameters
otherObject to compare.
Returns
true if current object is equal to other, otherwise - false.

◆ Equals() [3/3]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::Equals ( const SharedPtr< Object > &  obj) const

Checks if two DateTimeOffset objects represents the same time point.

Parameters
objObject to compare.
Returns
true if current object is equal to obj, otherwise - false.

◆ EqualsExact() [1/2]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::EqualsExact ( const DateTimeOffset other) const

Checks if two DateTimeOffset objects represents the same time point and has the same offset.

Parameters
otherObject to compare.
Returns
true if current object is exact equal to other, otherwise - false.

◆ EqualsExact() [2/2]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::EqualsExact ( const SharedPtr< Object > &  obj) const

Checks if two DateTimeOffset objects represents the same time point and has the same offset.

Parameters
objObject to compare.
Returns
true if current object is exact equal to obj, otherwise - false.

◆ FromFileTime()

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::FromFileTime ( int64_t  file_time)
static

Convert Windows file time to date and time with local time offset.

Parameters
file_timeWindows file time.
Returns
Date and time with local time offset.

◆ FromUnixTimeMilliseconds()

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::FromUnixTimeMilliseconds ( int64_t  milliseconds)
static

Convert Unix-time to DateTimeOffset object.

Parameters
millisecondsUnix-time (number of milliseconds elapsed from 1970-01-01).
Returns
Date and time with zero offset.

◆ FromUnixTimeSeconds()

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::FromUnixTimeSeconds ( int64_t  seconds)
static

Convert Unix-time to DateTimeOffset object.

Parameters
secondsUnix-time (number of seconds elapsed from 1970-01-01).
Returns
Date and time with zero offset.

◆ get_Date()

ASPOSECPP_SHARED_API DateTime System::DateTimeOffset::get_Date ( ) const

Gets date component of the current object.

◆ get_DateTime()

ASPOSECPP_SHARED_API DateTime System::DateTimeOffset::get_DateTime ( ) const

Gets DateTime value.

◆ get_Day()

ASPOSECPP_SHARED_API int System::DateTimeOffset::get_Day ( ) const

Gets day of the month of the current object.

◆ get_DayOfWeek()

ASPOSECPP_SHARED_API DayOfWeek System::DateTimeOffset::get_DayOfWeek ( ) const

Gets day of the week of the current object.

◆ get_DayOfYear()

ASPOSECPP_SHARED_API int System::DateTimeOffset::get_DayOfYear ( ) const

Gets day of year of the current object.

◆ get_Hour()

ASPOSECPP_SHARED_API int System::DateTimeOffset::get_Hour ( ) const

Gets hour component of the current object.

◆ get_LocalDateTime()

ASPOSECPP_SHARED_API DateTime System::DateTimeOffset::get_LocalDateTime ( ) const

Gets DateTime value that represents the local date and time.

◆ get_Millisecond()

constexpr int System::DateTimeOffset::get_Millisecond ( ) const
inline

Gets millisecond component of the current object.

◆ get_Minute()

ASPOSECPP_SHARED_API int System::DateTimeOffset::get_Minute ( ) const

Gets minute component of the current object.

◆ get_Month()

ASPOSECPP_SHARED_API int System::DateTimeOffset::get_Month ( ) const

Gets month component of the current object.

◆ get_Now()

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::get_Now ( )
static

Gets DateTimeOffset whose date and time are set to the current local-time and whose offset is set to local time's offset.

◆ get_Offset()

constexpr TimeSpan System::DateTimeOffset::get_Offset ( ) const
inline

Gets offset from UTC.

◆ get_Second()

constexpr int System::DateTimeOffset::get_Second ( ) const
inline

Gets second component of the current object.

◆ get_Ticks()

ASPOSECPP_SHARED_API int64_t System::DateTimeOffset::get_Ticks ( ) const

Gets number of ticks of the current object.

◆ get_TimeOfDay()

ASPOSECPP_SHARED_API TimeSpan System::DateTimeOffset::get_TimeOfDay ( ) const

Gets time of day of the current object.

◆ get_UtcDateTime()

ASPOSECPP_SHARED_API DateTime System::DateTimeOffset::get_UtcDateTime ( ) const

Gets DateTime value that represents the UTC date and time.

◆ get_UtcNow()

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::get_UtcNow ( )
static

Gets DateTimeOffset whose date and time are set to the current UTC-time and whose offset is TimeSpan::Zero.

◆ get_UtcTicks()

ASPOSECPP_SHARED_API int64_t System::DateTimeOffset::get_UtcTicks ( ) const

Gets number of ticks of the current object in UTC time.

◆ get_Year()

ASPOSECPP_SHARED_API int System::DateTimeOffset::get_Year ( ) const

Gets year component of the current object.

◆ GetHashCode()

ASPOSECPP_SHARED_API int System::DateTimeOffset::GetHashCode ( ) const

Gets hash code for the current DateTimeOffset object.

Returns
A 32-bit signed integer hash code.

◆ IsNull()

constexpr bool System::DateTimeOffset::IsNull ( ) const
inline

◆ operator!=() [1/2]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::operator!= ( const DateTimeOffset other) const

Determines if the current object and the specified DateTimeOffset object represent distinct date and time values.

Parameters
otherThe DateTimeOffset object to compare the current object with
Returns
True if the current object and the specified object represent distinct date and time values, otherwise - false

◆ operator!=() [2/2]

constexpr bool System::DateTimeOffset::operator!= ( std::nullptr_t  ) const
inline

◆ operator+()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::operator+ ( TimeSpan  value) const

Returns a new instance of DateTimeOffset class that represents the date and time value that is the sum of the value represented by the current object and the specified time span.

Parameters
valueThe time span to add to the value represented by the current object
Returns
A new instance of DateTimeOffset class that represents the date and time value that is the sum of the value represented by the current object and value.

◆ operator-() [1/2]

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::operator- ( TimeSpan  value) const

Returns a new instance of the DateTimeOffset class representing the date and time value which is the result of subtraction of the specified time span from the value represented by the current object.

Parameters
valueA time interval to subtract
Returns
A new instance of the DateTimeOffset class representing the date and time value which is the result of subtraction of value from the value represented by the current object.

◆ operator-() [2/2]

ASPOSECPP_SHARED_API TimeSpan System::DateTimeOffset::operator- ( const DateTimeOffset other) const

Returns an instance of TimeSpan class that represents the time interval between the date and time values represented by the current and the specified objects.

Parameters
otherAn instance of DateTime class that marks one end of the interval to be calculated
Returns
An instance of TimeSpan class representing the time interval between the date and time values represented by the current object and other.

◆ operator<() [1/2]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::operator< ( const DateTimeOffset other) const

Determines if the current object represents the date and time value that is earlier than the value represented by the specified DateTimeOffset object.

Parameters
otherThe DateTimeOffset object to compare the current object with
Returns
True if the date and time value represented by the current object is earlier than the value represented by other, otherwise - false

◆ operator<() [2/2]

constexpr bool System::DateTimeOffset::operator< ( std::nullptr_t  ) const
inline

◆ operator<=() [1/2]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::operator<= ( const DateTimeOffset other) const

Determines if the current object represents the date and time value that is earlier than or the same as the value represented by the specified DateTimeOffset object.

Parameters
otherThe DateTimeOffset object to compare the current object with
Returns
True if the date and time value represented by the current object is earlier than or the same as the value represented by other, otherwise - false

◆ operator<=() [2/2]

constexpr bool System::DateTimeOffset::operator<= ( std::nullptr_t  ) const
inline

◆ operator==() [1/2]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::operator== ( const DateTimeOffset other) const

Determines if the current object and the specified DateTimeOffset object represent the same date and time value.

Parameters
otherThe DateTimeOffset object to compare the current object with
Returns
True if the current object and the specified object represent the same date and time value, otherwise - false

◆ operator==() [2/2]

constexpr bool System::DateTimeOffset::operator== ( std::nullptr_t  ) const
inline

◆ operator>() [1/2]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::operator> ( const DateTimeOffset other) const

Determines if the current object represents the date and time value that is later than the value represented by the specified DateTimeOffset object.

Parameters
otherThe DateTimeOffset object to compare the current object with
Returns
True if the date and time value represented by the current object is later than the value represented by other, otherwise - false

◆ operator>() [2/2]

constexpr bool System::DateTimeOffset::operator> ( std::nullptr_t  ) const
inline

◆ operator>=() [1/2]

ASPOSECPP_SHARED_API bool System::DateTimeOffset::operator>= ( const DateTimeOffset other) const

Determines if the current object represents the date and time value that is later than or the same as the value represented by the specified DateTimeOffset object.

Parameters
otherThe DateTimeOffset object to compare the current object with
Returns
True if the date and time value represented by the current object is later than or the same as the value represented by other, otherwise - false

◆ operator>=() [2/2]

constexpr bool System::DateTimeOffset::operator>= ( std::nullptr_t  ) const
inline

◆ Parse() [1/2]

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::Parse ( const String input)
static

Converts the specified string to DateTimeOffset equivalent.

Parameters
inputString to convert.
Returns
DateTimeOffset that is equivalent to the input.

◆ Parse() [2/2]

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::Parse ( const String input,
const SharedPtr< IFormatProvider > &  provider,
Globalization::DateTimeStyles  styles = Globalization::DateTimeStyles::None 
)
static

Converts the specified string to DateTimeOffset object using the specified format provider and formatting style.

Parameters
inputString to convert.
providerFormat provider.
stylesDate and time formatting styles.
Returns
DateTimeOffset that is equivalent to the input.

◆ ParseExact() [1/2]

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::ParseExact ( const String input,
const String format,
const SharedPtr< IFormatProvider > &  provider,
Globalization::DateTimeStyles  styles = Globalization::DateTimeStyles::None 
)
static

Converts the specified string to DateTimeOffset object using the specified format, format provider and formatting style.

Parameters
inputString to convert.
formatFormat string.
providerFormat provider.
stylesDate and time formatting styles.
Returns
DateTimeOffset that is equivalent to the input.

◆ ParseExact() [2/2]

static ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::ParseExact ( const String input,
const ArrayPtr< String > &  formats,
const SharedPtr< IFormatProvider > &  provider,
Globalization::DateTimeStyles  styles 
)
static

Converts the specified string to DateTimeOffset object using the specified formats, format provider and formatting style.

Parameters
inputString to convert.
formatsArray of format strings.
providerFormat provider.
stylesDate and time formatting styles.
Returns
DateTimeOffset that is equivalent to the input.

◆ Subtract() [1/2]

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::Subtract ( TimeSpan  value) const

Subtracts a specified time interval from the current object.

Parameters
valueValue to subtract.
Returns
Result of operation.

◆ Subtract() [2/2]

ASPOSECPP_SHARED_API TimeSpan System::DateTimeOffset::Subtract ( const DateTimeOffset value) const

Subtracts a specified DateTimeOffset value from the current object.

Parameters
valueValue to subtract.
Returns
Result of operation.

◆ ToFileTime()

ASPOSECPP_SHARED_API int64_t System::DateTimeOffset::ToFileTime ( ) const

Converts current object to the Windows file time.

Returns
Current DateTimeOffset object expressed as windows file time.

◆ ToLocalTime()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::ToLocalTime ( ) const

Converts current object to a object that represents the local time,

Returns
Current DateTimeOffset object converted to local time.

◆ ToOffset()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::ToOffset ( TimeSpan  offset) const

Replace current object offset by the specified offset.

Parameters
offsetUTC-offset.
Returns
Current DateTimeOffset object converted to the date and time with specified offset.

◆ ToString() [1/4]

ASPOSECPP_SHARED_API String System::DateTimeOffset::ToString ( const String format,
const SharedPtr< IFormatProvider > &  provider 
) const

Converts current object to string using the specified format and format provider.

Parameters
formatFormat string.
providerFormat provider.
Returns
String representation of the current DateTimeOffset object.

◆ ToString() [2/4]

ASPOSECPP_SHARED_API String System::DateTimeOffset::ToString ( const SharedPtr< IFormatProvider > &  provider) const

Converts current object to string using the specified format provider.

Parameters
providerFormat provider.
Returns
String representation of the current DateTimeOffset object.

◆ ToString() [3/4]

ASPOSECPP_SHARED_API String System::DateTimeOffset::ToString ( const String format) const

Converts current object to string using the specified format.

Parameters
formatFormat string.
Returns
String representation of the current DateTimeOffset object.

◆ ToString() [4/4]

ASPOSECPP_SHARED_API String System::DateTimeOffset::ToString ( ) const

Converts current object to string.

Returns
String representation of the current DateTimeOffset object.

◆ ToUniversalTime()

ASPOSECPP_SHARED_API DateTimeOffset System::DateTimeOffset::ToUniversalTime ( ) const

Converts current object to a object that represents the UTC time,

Returns
Current DateTimeOffset object converted to UTC-time.

◆ ToUnixTimeMilliseconds()

ASPOSECPP_SHARED_API int64_t System::DateTimeOffset::ToUnixTimeMilliseconds ( ) const

Gets milliseconds elapsed from Unix epoch start.

Returns
Number of milliseconds elapsed since 1970-01-01.

◆ ToUnixTimeSeconds()

ASPOSECPP_SHARED_API int64_t System::DateTimeOffset::ToUnixTimeSeconds ( ) const

Gets seconds elapsed from Unix epoch start.

Returns
Number of seconds elapsed since 1970-01-01.

◆ TryParse() [1/2]

static ASPOSECPP_SHARED_API bool System::DateTimeOffset::TryParse ( const String input,
DateTimeOffset result 
)
static

Tries to converts the specified string to DateTimeOffset object.

Parameters
inputString to convert.
resultDateTimeOffset that is equivalent to the input.
Returns
true if the input converted successfully, otherwise - false.

◆ TryParse() [2/2]

static ASPOSECPP_SHARED_API bool System::DateTimeOffset::TryParse ( const String input,
const SharedPtr< IFormatProvider > &  provider,
Globalization::DateTimeStyles  styles,
DateTimeOffset result 
)
static

Tries to converts the specified string to DateTimeOffset object using the specified format provider and formatting style.

Parameters
inputString to convert.
providerFormat provider.
stylesDate and time formatting styles.
resultDateTimeOffset that is equivalent to the input.
Returns
true if the input converted successfully, otherwise - false.

◆ TryParseExact() [1/2]

static ASPOSECPP_SHARED_API bool System::DateTimeOffset::TryParseExact ( const String input,
const ArrayPtr< String > &  formats,
const SharedPtr< IFormatProvider > &  provider,
Globalization::DateTimeStyles  styles,
DateTimeOffset result 
)
static

Tries to converts the specified string to DateTimeOffset object using the specified formats, format provider and formatting style.

Parameters
inputString to convert.
formatsArrays of format strings.
providerFormat provider.
stylesDate and time formatting styles.
resultDateTimeOffset that is equivalent to the input.
Returns
true if the input converted successfully, otherwise - false.

◆ TryParseExact() [2/2]

static ASPOSECPP_SHARED_API bool System::DateTimeOffset::TryParseExact ( const String input,
const String format,
const SharedPtr< IFormatProvider > &  provider,
Globalization::DateTimeStyles  styles,
DateTimeOffset result 
)
static

Tries to converts the specified string to DateTimeOffset object using the specified format, format provider and formatting style.

Parameters
inputString to convert.
formatFormat string.
providerFormat provider.
stylesDate and time formatting styles.
resultDateTimeOffset that is equivalent to the input.
Returns
true if the input converted successfully, otherwise - false.

◆ Type()

static const TypeInfo& System::DateTimeOffset::Type ( )
inlinestatic

Returns a TypeInfo object that represent TimeSpan structure.

Member Data Documentation

◆ MaxOffset

constexpr int64_t System::DateTimeOffset::MaxOffset = TimeSpan::TicksPerHour * 14
static

Gets maximum offset in ticks.

◆ MaxValue

ASPOSECPP_SHARED_API const DateTimeOffset System::DateTimeOffset::MaxValue
static

Gets greatest DateTimeOffset value.

◆ MinOffset

constexpr int64_t System::DateTimeOffset::MinOffset = -MaxOffset
static

Gets minimum offset in ticks.

◆ MinValue

ASPOSECPP_SHARED_API const DateTimeOffset System::DateTimeOffset::MinValue
static

Gets earliest DateTimeOffset value.

◆ UnixEpoch

ASPOSECPP_SHARED_API const DateTimeOffset System::DateTimeOffset::UnixEpoch
static

Gets Unix epoch start.