Public Member Functions | |
constexpr | DateTime () |
Constructs an instance that represents the smallest possible date and time value equal to MinValue. More... | |
ASPOSECPP_SHARED_API | DateTime (int year, int month, int day) |
ASPOSECPP_SHARED_API | DateTime (int year, int month, int day, const SharedPtr< Globalization::Calendar > &calendar) |
ASPOSECPP_SHARED_API | DateTime (int year, int month, int day, int hour, int minute, int second) |
ASPOSECPP_SHARED_API | DateTime (int year, int month, int day, int hour, int minute, int second, DateTimeKind kind) |
ASPOSECPP_SHARED_API | DateTime (int year, int month, int day, int hour, int minute, int second, const SharedPtr< Globalization::Calendar > &calendar) |
ASPOSECPP_SHARED_API | DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, DateTimeKind kind=DateTimeKind::Unspecified) |
ASPOSECPP_SHARED_API | DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, const SharedPtr< Globalization::Calendar > &calendar, DateTimeKind kind=DateTimeKind::Unspecified) |
ASPOSECPP_SHARED_API | DateTime (int64_t ticks, DateTimeKind kind=DateTimeKind::Unspecified) |
DateTime (int64_t ticks, DateTimeKind kind, bool is_ambiguous_local_dst) | |
DateTime (const DateTime &dt)=default | |
DateTime & | operator= (const DateTime &dt)=default |
constexpr DateTime | get_Date () const |
Returns a new instance of DateTime class that represents the date portion of the date and time represented by the current object with each component of the time portion set to 0. More... | |
constexpr DayOfWeek | get_DayOfWeek () const |
Returns a value representing a day of week that is represented by the current object. More... | |
constexpr DateTimeKind | get_Kind () const |
Returns the value representing if the date and time represented by the current object is a local or UTC date and time or neither. More... | |
constexpr TimeSpan | get_TimeOfDay () const |
Returns the value that represents the time interval from the beginning of the day represented by the current object till the date and time value represented by the current object. More... | |
ASPOSECPP_SHARED_API int | get_DayOfYear () const |
Returns the ordinal number of the day in the year represented by the current object. More... | |
ASPOSECPP_SHARED_API int | get_Year () const |
Returns the year represented by the current object. More... | |
ASPOSECPP_SHARED_API int | get_Month () const |
Returns the ordinal number of the month in the year represented by the current object. More... | |
ASPOSECPP_SHARED_API int | get_Day () const |
Returns the ordinal number of the day in the month represented by the current object. More... | |
void | GetDateComponents (int &year, int &month, int &day) const |
Gets date parts. FOR INTERNAL USE. More... | |
constexpr int | get_Hour () const |
Returns the hour component of the date and time value represented by the current object. More... | |
constexpr int | get_Minute () const |
Returns the minute component of the date and time value represented by the current object. More... | |
constexpr int | get_Second () const |
Returns the second component of the date and time value represented by the current object. More... | |
constexpr int | get_Millisecond () const |
Returns the millisecond component of the date and time value represented by the current object. More... | |
constexpr int64_t | get_Ticks () const |
Returns a number of 100-nanosecond intervals passed since 0:00:00 UTC, January 1, 0001, in the Gregorian calendar until the date and time represented by the current object. More... | |
ASPOSECPP_SHARED_API DateTime | Add (TimeSpan value) const |
ASPOSECPP_SHARED_API DateTime | AddYears (int value) const |
ASPOSECPP_SHARED_API DateTime | AddMonths (int value) const |
ASPOSECPP_SHARED_API DateTime | AddDays (double value) const |
ASPOSECPP_SHARED_API DateTime | AddHours (double value) const |
ASPOSECPP_SHARED_API DateTime | AddMinutes (double value) const |
ASPOSECPP_SHARED_API DateTime | AddSeconds (double value) const |
ASPOSECPP_SHARED_API DateTime | AddMilliseconds (double value) const |
ASPOSECPP_SHARED_API DateTime | AddTicks (int64_t value) const |
ASPOSECPP_SHARED_API DateTime | Subtract (TimeSpan duration) const |
constexpr TimeSpan | Subtract (DateTime value) const |
ASPOSECPP_SHARED_API DateTime | ToLocalTime () const |
Returns a new instance of DateTime class that represents the date and time value represented by the current object as local time. More... | |
ASPOSECPP_SHARED_API DateTime | ToUniversalTime () const |
Returns a new instance of DateTime class that represents the date and time value represented by the current object as UTC. More... | |
time_t | ToUnixTime () const |
Returns a value that represents the date and time value represented by the current object as Unix time. FOR INTERNAL USE. More... | |
ASPOSECPP_SHARED_API int64_t | ToFileTime () const |
Returns a value that represents the date and time value represented by the current object as File time. More... | |
ASPOSECPP_SHARED_API int64_t | ToFileTimeUtc () const |
ASPOSECPP_SHARED_API int64_t | ToBinary () const |
ASPOSECPP_SHARED_API double | ToOADate () const |
Returns the date and time value represented by the current object as OLE Automation Date. More... | |
ASPOSECPP_SHARED_API bool | IsDaylightSavingTime () const |
constexpr int | CompareTo (DateTime value) const |
constexpr bool | Equals (DateTime other) const |
ASPOSECPP_SHARED_API int | GetHashCode () const |
Returns a hash code for the current object. More... | |
ASPOSECPP_SHARED_API String | ToString () const |
ASPOSECPP_SHARED_API String | ToString (const String &format) const |
ASPOSECPP_SHARED_API String | ToString (const SharedPtr< IFormatProvider > &provider) const |
ASPOSECPP_SHARED_API String | ToString (const SharedPtr< Globalization::CultureInfo > &culture) const |
ASPOSECPP_SHARED_API String | ToString (const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi) const |
String | ToString (std::nullptr_t) const |
ASPOSECPP_SHARED_API String | ToString (const String &format, const SharedPtr< IFormatProvider > &provider) const |
ASPOSECPP_SHARED_API String | ToString (const String &format, const SharedPtr< Globalization::CultureInfo > &culture) const |
ASPOSECPP_SHARED_API String | ToString (const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi) const |
String | ToString (const String &format, std::nullptr_t) const |
ASPOSECPP_SHARED_API String | ToShortDateString () const |
Returns a string that contains the short date string representation of the current object. More... | |
ASPOSECPP_SHARED_API String | ToLongDateString () const |
Returns a string that contains the long date string representation of the current object. More... | |
ASPOSECPP_SHARED_API String | ToShortTimeString () const |
Returns a string that contains the short time string representation of the current object. More... | |
ASPOSECPP_SHARED_API String | ToLongTimeString () const |
Returns a string that contains the long time string representation of the current object. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | GetDateTimeFormats () const |
ASPOSECPP_SHARED_API ArrayPtr< String > | GetDateTimeFormats (char_t format) const |
ASPOSECPP_SHARED_API ArrayPtr< String > | GetDateTimeFormats (const SharedPtr< IFormatProvider > &provider) const |
ASPOSECPP_SHARED_API ArrayPtr< String > | GetDateTimeFormats (char_t format, const SharedPtr< IFormatProvider > &provider) const |
constexpr bool | operator== (DateTime other) const |
constexpr bool | operator!= (DateTime other) const |
constexpr bool | operator< (DateTime other) const |
constexpr bool | operator<= (DateTime other) const |
constexpr bool | operator> (DateTime other) const |
constexpr bool | operator>= (DateTime other) const |
DateTime | operator+ (TimeSpan value) const |
DateTime | operator- (TimeSpan value) const |
DateTime & | operator+= (TimeSpan value) |
DateTime & | operator-= (TimeSpan value) |
constexpr TimeSpan | operator- (DateTime value) 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 DateTime | get_Now () |
Returns an instance of DateTime class that represents the current time as local time. More... | |
static ASPOSECPP_SHARED_API DateTime | get_UtcNow () |
Returns an instance of DateTime class that represents the current time as UTC. More... | |
static ASPOSECPP_SHARED_API DateTime | get_Today () |
Returns an instance of DateTime class that represents the current date with each component of time portion of the value represented by the object set to 0. More... | |
static ASPOSECPP_SHARED_API DateTime | FromBinary (int64_t value) |
static ASPOSECPP_SHARED_API DateTime | FromFileTimeUtc (int64_t file_time) |
static ASPOSECPP_SHARED_API DateTime | FromOADate (double date) |
static DateTime | FromUnixTime (time_t value) |
static ASPOSECPP_SHARED_API DateTime | FromFileTime (int64_t value) |
static ASPOSECPP_SHARED_API int | DaysInMonth (int year, int month) |
static ASPOSECPP_SHARED_API bool | IsLeapYear (int year) |
static DateTime | SpecifyKind (DateTime value, DateTimeKind kind) |
static constexpr int | Compare (DateTime t1, DateTime t2) |
static constexpr bool | Equals (DateTime t1, DateTime t2) |
static ASPOSECPP_SHARED_API DateTime | Parse (const String &s) |
static ASPOSECPP_SHARED_API DateTime | Parse (const String &s, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static ASPOSECPP_SHARED_API DateTime | Parse (const String &s, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static ASPOSECPP_SHARED_API DateTime | Parse (const String &s, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static ASPOSECPP_SHARED_API DateTime | Parse (const String &s, std::nullptr_t, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static ASPOSECPP_SHARED_API DateTime | ParseExact (const String &s, const String &format, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static ASPOSECPP_SHARED_API DateTime | ParseExact (const String &s, const String &format, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static ASPOSECPP_SHARED_API DateTime | ParseExact (const String &s, const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static ASPOSECPP_SHARED_API DateTime | ParseExact (const String &s, const String &format, std::nullptr_t, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static ASPOSECPP_SHARED_API DateTime | ParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles) |
static ASPOSECPP_SHARED_API DateTime | ParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles) |
static ASPOSECPP_SHARED_API DateTime | ParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles) |
static ASPOSECPP_SHARED_API DateTime | ParseExact (const String &s, const ArrayPtr< String > &formats, std::nullptr_t, Globalization::DateTimeStyles styles) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &s, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &s, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &s, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &s, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &s, std::nullptr_t, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &s, const String &format, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &s, const String &format, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &s, const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &s, const String &format, std::nullptr_t, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles, DateTime &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &s, const ArrayPtr< String > &formats, std::nullptr_t, Globalization::DateTimeStyles styles, DateTime &result) |
static const TypeInfo & | Type () |
Returns a TypeInfo object that contains information about this class. More... | |
Static Public Attributes | |
static constexpr int64_t | TicksPerMicrosecond = 10 |
The number of ticks in a microsecond. More... | |
static constexpr int64_t | TicksPerMillisecond = 10000 |
The number of ticks in a millisecond. More... | |
static constexpr int64_t | TicksPerSecond = TicksPerMillisecond * 1000 |
The number of ticks in a second. More... | |
static constexpr int64_t | TicksPerMinute = TicksPerSecond * 60 |
The number of ticks in a minute. More... | |
static constexpr int64_t | TicksPerHour = TicksPerMinute * 60 |
The number of ticks in a hour. More... | |
static constexpr int64_t | TicksPerDay = TicksPerHour * 24 |
The number of ticks in a day. More... | |
static constexpr int64_t | MinTicks = 0 |
The minimal number of ticks that an instance of DateTime class can represent. More... | |
static constexpr int64_t | MaxTicks = 3652059 * TicksPerDay - 1 |
The number of 100-nanosecond in the time interval between the minimal possible and maximal possible DateTime value. More... | |
static ASPOSECPP_SHARED_API const DateTime | MinValue |
An instance of DateTime class that represents the minimal possible date and time value. More... | |
static ASPOSECPP_SHARED_API const DateTime | MaxValue |
An instance of DateTime class that represents the maximal possible date and time value. More... | |
static ASPOSECPP_SHARED_API const DateTime | UnixEpoch |
An instance of DateTime class that represents the Unix epoch start (1970.01.01 00:00:00). More... | |
Represents a specific date and time value on the time continuum. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.
|
inline |
Constructs an instance that represents the smallest possible date and time value equal to MinValue.
ASPOSECPP_SHARED_API System::DateTime::DateTime | ( | int | year, |
int | month, | ||
int | day | ||
) |
Constructs an instance that represents a date and time value specified as a particular year, month and day.
year | The year to be represented by the instance being constructed. |
month | The month of the year to be represented by the instance being constructed. |
day | The day of the month to be represented by the instance being constructed. |
ASPOSECPP_SHARED_API System::DateTime::DateTime | ( | int | year, |
int | month, | ||
int | day, | ||
const SharedPtr< Globalization::Calendar > & | calendar | ||
) |
Constructs an instance that represents a date and time value specified as a particular year, month and day in the specified calendar.
year | The year to be represented by the instance being constructed. |
month | The month of the year to be represented by the instance being constructed. |
day | The day of the month to be represented by the instance being constructed. |
calendar | The calendar used to interpret the specified year , month and day . |
ASPOSECPP_SHARED_API System::DateTime::DateTime | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | minute, | ||
int | second | ||
) |
Constructs an instance that represents a date and time value specified as a particular year, month, day, hour, minute and second.
year | The year to be represented by the instance being constructed. |
month | The month of the year to be represented by the instance being constructed. |
day | The day of the month to be represented by the instance being constructed. |
hour | The hour of the day to be represented by the instance being constructed. |
minute | The minute of the hour to be represented by the instance being constructed. |
second | The second of the minute te be represented by the instance being constructed. |
ASPOSECPP_SHARED_API System::DateTime::DateTime | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | minute, | ||
int | second, | ||
DateTimeKind | kind | ||
) |
Constructs an instance that represents a date and time value specified as a particular year, month, day, hour, minute and second.
year | The year to be represented by the instance being constructed. |
month | The month of the year to be represented by the instance being constructed. |
day | The day of the month to be represented by the instance being constructed. |
hour | The hour of the day to be represented by the instance being constructed. |
minute | The minute of the hour to be represented by the instance being constructed. |
second | The second of the minute te be represented by the instance being constructed. |
kind | The value that indicates if the provided date and time parameters specify a local time, UTC time or neither. |
ASPOSECPP_SHARED_API System::DateTime::DateTime | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | minute, | ||
int | second, | ||
const SharedPtr< Globalization::Calendar > & | calendar | ||
) |
Constructs an instance that represents a date and time value specified as a particular year, month, day, hour, minute and second in the specified calendar.
year | The year to be represented by the instance being constructed. |
month | The month of the year to be represented by the instance being constructed. |
day | The day of the month to be represented by the instance being constructed. |
hour | The hour of the day to be represented by the instance being constructed. |
minute | The minute of the hour to be represented by the instance being constructed. |
second | The second of the minute te be represented by the instance being constructed. |
calendar | The calendar used to interpret the specified year , month and day . |
ASPOSECPP_SHARED_API System::DateTime::DateTime | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | minute, | ||
int | second, | ||
int | millisecond, | ||
DateTimeKind | kind = DateTimeKind::Unspecified |
||
) |
Constructs an instance that represents a date and time value specified as a particular year, month, day, hour, minute, second and millisecond.
year | The year to be represented by the instance being constructed. |
month | The month of the year to be represented by the instance being constructed. |
day | The day of the month to be represented by the instance being constructed. |
hour | The hour of the day to be represented by the instance being constructed. |
minute | The minute of the hour to be represented by the instance being constructed. |
second | The second of the minute te be represented by the instance being constructed. |
millisecond | The millisecond of the second to be represented by the instance being constructed. |
kind | The value that indicates if the provided date and time parameters specify a local time, UTC time or neither. |
ASPOSECPP_SHARED_API System::DateTime::DateTime | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | minute, | ||
int | second, | ||
int | millisecond, | ||
const SharedPtr< Globalization::Calendar > & | calendar, | ||
DateTimeKind | kind = DateTimeKind::Unspecified |
||
) |
Constructs an instance that represents a date and time value specified as a particular year, month, day, hour, minute, second and millisecond in the specified calendar.
year | The year to be represented by the instance being constructed. |
month | The month of the year to be represented by the instance being constructed. |
day | The day of the month to be represented by the instance being constructed. |
hour | The hour of the day to be represented by the instance being constructed. |
minute | The minute of the hour to be represented by the instance being constructed. |
second | The second of the minute te be represented by the instance being constructed. |
millisecond | The millisecond of the second to be represented by the instance being constructed. |
kind | The value that indicates if the provided date and time parameters specify a local time, UTC time or neither. |
calendar | The calendar used to interpret the specified year , month and day . |
ASPOSECPP_SHARED_API System::DateTime::DateTime | ( | int64_t | ticks, |
DateTimeKind | kind = DateTimeKind::Unspecified |
||
) |
Construct an instance that represents a date and time value specified as a number of ticks.
ticks | The number of 100-ns intervals that have passed since January the 1st, 0001 00:00:00.000 in Georgian calendar. |
kind | The value that indicates if ticks parameter specifies a local time, UTC time or neither. |
System::DateTime::DateTime | ( | int64_t | ticks, |
DateTimeKind | kind, | ||
bool | is_ambiguous_local_dst | ||
) |
Construct an instance that represents a date and time value specified as a number of ticks. FOR INTERNAL USE.
ticks | The number of 100-ns intervals that have passed since January the 1st, 0001 00:00:00.000 in Georgian calendar. |
kind | The value that indicates if ticks parameter specifies a local time, UTC time or neither. |
is_ambiguous_local_dst | True if specified date and time is ambiguous and can be mapped to many UTC times. |
|
default |
Copy-constructs an instance.
dt | An instance of DateTime class to copy the represented date and time value from |
Returns a new instance of DateTime class that represents a date and time value that results from addition of the specified time span to the date and time value represented by the current object.
value | The time interval to add |
tm
time span to the date and time value represented by the current object ASPOSECPP_SHARED_API DateTime System::DateTime::AddDays | ( | double | value | ) | const |
Returns a new instance of the DateTime class representing the date and time value which is the sum of the value represented by the current object and the specified number of days.
value | The number of days to add; the value can be positive or negative |
value
days ASPOSECPP_SHARED_API DateTime System::DateTime::AddHours | ( | double | value | ) | const |
Returns a new instance of the DateTime class representing the date and time value which is the sum of the value represented by the current object and the specified number of hours.
value | The number of hours to add; the value can be positive or negative |
value
hours ASPOSECPP_SHARED_API DateTime System::DateTime::AddMilliseconds | ( | double | value | ) | const |
Returns a new instance of the DateTime class representing the date and time value which is the sum of the value represented by the current object and the specified number of milliseconds.
value | The number of milliseconds to add; the value can be positive or negative |
value
milliseconds ASPOSECPP_SHARED_API DateTime System::DateTime::AddMinutes | ( | double | value | ) | const |
Returns a new instance of the DateTime class representing the date and time value which is the sum of the value represented by the current object and the specified number of minutes.
value | The number of minutes to add; the value can be positive or negative |
value
minutes ASPOSECPP_SHARED_API DateTime System::DateTime::AddMonths | ( | int | value | ) | const |
Returns a new instance of the DateTime class representing the date and time value which is the sum of the value represented by the current object and the specified number of months.
value | The number of months to add; the value can be positive or negative |
value
months ASPOSECPP_SHARED_API DateTime System::DateTime::AddSeconds | ( | double | value | ) | const |
Returns a new instance of the DateTime class representing the date and time value which is the sum of the value represented by the current object and the specified number of seconds.
value | The number of seconds to add; the value can be positive or negative |
value
seconds ASPOSECPP_SHARED_API DateTime System::DateTime::AddTicks | ( | int64_t | value | ) | const |
Returns a new instance of the DateTime class representing the date and time value which is the sum of the value represented by the current object and the specified number of 100-nanosecond intervals.
value | The number of 100-nanosecond intervals to add; the value can be positive or negative |
value
of 100-nanosecond intervals ASPOSECPP_SHARED_API DateTime System::DateTime::AddYears | ( | int | value | ) | const |
Returns a new instance of the DateTime class representing the date and time value equal to that represented by the current object with the year component increased by the specified number.
value | The number of years to add; the value can be positive or negative |
value
Compares two values represented by the specified instances of DateTime class and returns the value indicating values' relative positions on the time line.
t1 | The first comparand |
t2 | The second comparand |
t1
is earlier than t2
; 0 if t1
is the same as t2
; a value that is greater than 0 if t1
is later than t2
|
inline |
Compares two date and time values represented by the current object and the specified instance of DateTime class and returns the value indicating values' relative positions on the time line.
value | An instance of DateTime class to compare the current object with |
value
; 0 if values represented by both objects are the same; a value that is greater than 0 if the value represented by the current object is later than that represented by value
|
static |
Returns the number of days in the specified month of the specified year.
year | The year |
month | The ordinal number of the month |
Determines if the specified instances of DateTime class represent the same date and time value
t1 | The first comparand |
t2 | The second comparand |
t1
and t2
represent the same value, otherwise - false
|
inline |
|
static |
Deserializes the date time value from the specified unsigned 64-bit integer and sets the new instance of DateTime class to that value.
value | The 64-bit integer to deserialize the date and time value from |
|
static |
|
static |
|
static |
|
static |
|
inline |
Returns a new instance of DateTime class that represents the date portion of the date and time represented by the current object with each component of the time portion set to 0.
ASPOSECPP_SHARED_API int System::DateTime::get_Day | ( | ) | const |
Returns the ordinal number of the day in the month represented by the current object.
|
inline |
Returns a value representing a day of week that is represented by the current object.
ASPOSECPP_SHARED_API int System::DateTime::get_DayOfYear | ( | ) | const |
Returns the ordinal number of the day in the year represented by the current object.
|
inline |
Returns the hour component of the date and time value represented by the current object.
|
inline |
Returns the value representing if the date and time represented by the current object is a local or UTC date and time or neither.
|
inline |
Returns the millisecond component of the date and time value represented by the current object.
|
inline |
Returns the minute component of the date and time value represented by the current object.
ASPOSECPP_SHARED_API int System::DateTime::get_Month | ( | ) | const |
Returns the ordinal number of the month in the year represented by the current object.
|
static |
Returns an instance of DateTime class that represents the current time as local time.
|
inline |
Returns the second component of the date and time value represented by the current object.
|
inline |
Returns a number of 100-nanosecond intervals passed since 0:00:00 UTC, January 1, 0001, in the Gregorian calendar until the date and time represented by the current object.
|
inline |
Returns the value that represents the time interval from the beginning of the day represented by the current object till the date and time value represented by the current object.
|
static |
Returns an instance of DateTime class that represents the current date with each component of time portion of the value represented by the object set to 0.
|
static |
Returns an instance of DateTime class that represents the current time as UTC.
ASPOSECPP_SHARED_API int System::DateTime::get_Year | ( | ) | const |
Returns the year represented by the current object.
void System::DateTime::GetDateComponents | ( | int & | year, |
int & | month, | ||
int & | day | ||
) | const |
Gets date parts. FOR INTERNAL USE.
Returns array of strings where each element is the string representation of the current object formatted with one of the standard date and time format specifiers.
Returns array of strings where each element is the string representation of the current object formatted with the specified standard date and time format specifier.
format | Standard date and time format specifier. |
ASPOSECPP_SHARED_API ArrayPtr<String> System::DateTime::GetDateTimeFormats | ( | const SharedPtr< IFormatProvider > & | provider | ) | const |
Returns array of strings where each element is the string representation of the current object formatted with one of the standard date and time format specifiers and the specified format provider.
provider | Format provider. |
ASPOSECPP_SHARED_API ArrayPtr<String> System::DateTime::GetDateTimeFormats | ( | char_t | format, |
const SharedPtr< IFormatProvider > & | provider | ||
) | const |
Returns array of strings where each element is the string representation of the current object formatted with the specified standard date and time format specifier and format provider.
format | Standard date and time format specifier. |
provider | Format provider. |
ASPOSECPP_SHARED_API int System::DateTime::GetHashCode | ( | ) | const |
Returns a hash code for the current object.
ASPOSECPP_SHARED_API bool System::DateTime::IsDaylightSavingTime | ( | ) | const |
Determines if the date and time value represented by the current object falls in the range of daylight saving time for the current time zone.
|
static |
Determines of the specified year is a leap year.
year | The year to check |
|
inline |
|
inline |
|
inline |
Returns a new instance of DateTime 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.
value | The time span to add to the value represented by the current object |
value
. Sets the current object to the date and time value that is the sum of the value represented by the current object and the specified time span.
value | The time span to add |
Returns a new instance of the DateTime 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.
value | A time interval to subtract |
value
from the value represented by the current object. 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.
value | An instance of DateTime class that marks one end of the interval to be calculated |
value
. Sets the current object to the date and time value that is the result of subtraction of the specified time span from the date and time value represented by the current object.
value | The time span to subtract |
|
inline |
Determines if the current object represents the date and time value that is earlier than the value represented by the specified DateTime object.
other | The DateTime object to compare the current object with |
other
, otherwise - false
|
inline |
|
inline |
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 DateTime object.
other | The DateTime object to compare the current object with |
other
, otherwise - false
|
inline |
|
inline |
|
inline |
|
inline |
Determines if the current object represents the date and time value that is later than the value represented by the specified DateTime object.
other | The DateTime object to compare the current object with |
other
, otherwise - false
|
inline |
|
inline |
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 DateTime object.
other | The DateTime object to compare the current object with |
other
, otherwise - false
|
inline |
Converts the specified string representation of a date and time value to the equivalent DateTime object.
s | The string representation of a date and time value to convert. |
|
static |
Converts the specified string representation of a date and time value to the equivalent DateTime object using culture-specific format information.
s | The string representation of a date and time value to convert. |
provider | The IFormatProvider object that provides culture-specific format information. |
styles | A bitwise combination of the enumeration values that provides additional information about s , about style elements that may be present in s , or about the conversion from s to a DateTime object. |
|
static |
|
static |
|
static |
|
static |
Converts the specified string representation of a date and time value to the equivalent DateTime object using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly. Throws an exception if the conversion fails.
s | The string representation of a date and time value to convert. |
format | The string format. |
provider | The IFormatProvider object that provides culture-specific format information. |
styles | A bitwise combination of the enumeration values that provides additional information about s , about style elements that may be present in s , or about the conversion from s to a DateTime object. |
|
static |
|
static |
|
static |
|
static |
Converts the specified string representation of a date and time value to the equivalent DateTime object using the specified formats, culture-specific format information and style. The format of the string representation must match one or more of the specified formats exactly. Throws an exception if the conversion fails.
s | The string representation of a date and time value to convert. |
formats | The array of string formats. |
provider | The IFormatProvider object that provides culture-specific format information. |
styles | A bitwise combination of the enumeration values that provides additional information about s , about style elements that may be present in s , or about the conversion from s to a DateTime object. |
|
static |
|
static |
|
static |
|
inlinestatic |
Constructs a new DateTime object that represents the same number of ticks as the specified DateTime object and represents local time, UTC time or neither as specified by the argument kind
.
value | The DateTime object to copy the number of ticks from |
kind | Specifies if the new object should represent local time, UTC time or neither. |
value
and DateTimeKind value specified by kind
. Returns a new instance of the DateTime 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.
duration | A time interval to subtract |
duration
from the value represented by the current object. Returns an instance of TimeSpan class representing the time interval between the date and time values represented by the current and the specified objects.
value | An instance of DateTime class that marks one end of the interval to be calculated |
value
. ASPOSECPP_SHARED_API int64_t System::DateTime::ToBinary | ( | ) | const |
Serializes the current object.
ASPOSECPP_SHARED_API int64_t System::DateTime::ToFileTime | ( | ) | const |
Returns a value that represents the date and time value represented by the current object as File time.
ASPOSECPP_SHARED_API int64_t System::DateTime::ToFileTimeUtc | ( | ) | const |
Converts the date and time value represented by the current object to File time UTC.
ASPOSECPP_SHARED_API DateTime System::DateTime::ToLocalTime | ( | ) | const |
Returns a new instance of DateTime class that represents the date and time value represented by the current object as local time.
ASPOSECPP_SHARED_API String System::DateTime::ToLongDateString | ( | ) | const |
Returns a string that contains the long date string representation of the current object.
ASPOSECPP_SHARED_API String System::DateTime::ToLongTimeString | ( | ) | const |
Returns a string that contains the long time string representation of the current object.
ASPOSECPP_SHARED_API double System::DateTime::ToOADate | ( | ) | const |
Returns the date and time value represented by the current object as OLE Automation Date.
ASPOSECPP_SHARED_API String System::DateTime::ToShortDateString | ( | ) | const |
Returns a string that contains the short date string representation of the current object.
ASPOSECPP_SHARED_API String System::DateTime::ToShortTimeString | ( | ) | const |
Returns a string that contains the short time string representation of the current object.
ASPOSECPP_SHARED_API String System::DateTime::ToString | ( | ) | const |
Returns the string representation of the date and time value represented by the current object using the formatting conventions defined by the current culture.
Returns a string representation of the date and time value represented by the current object using the specified format and formatting conventions defined by the current culture.
format | A format string |
format
and the current culture. ASPOSECPP_SHARED_API String System::DateTime::ToString | ( | const SharedPtr< IFormatProvider > & | provider | ) | const |
Returns a string representation of the date and time value represented by the current object using the specified format information.
provider | An object representing the format information |
formatProvider
. ASPOSECPP_SHARED_API String System::DateTime::ToString | ( | const SharedPtr< Globalization::CultureInfo > & | culture | ) | const |
ASPOSECPP_SHARED_API String System::DateTime::ToString | ( | const SharedPtr< Globalization::DateTimeFormatInfo > & | dtfi | ) | const |
|
inline |
ASPOSECPP_SHARED_API String System::DateTime::ToString | ( | const String & | format, |
const SharedPtr< IFormatProvider > & | provider | ||
) | const |
Returns a string representation of the date and time value represented by the current object using the specified format information.
format | A format string |
provider | An object representing the format information |
provider
and format string format
. ASPOSECPP_SHARED_API String System::DateTime::ToString | ( | const String & | format, |
const SharedPtr< Globalization::CultureInfo > & | culture | ||
) | const |
ASPOSECPP_SHARED_API String System::DateTime::ToString | ( | const String & | format, |
const SharedPtr< Globalization::DateTimeFormatInfo > & | dtfi | ||
) | const |
ASPOSECPP_SHARED_API DateTime System::DateTime::ToUniversalTime | ( | ) | const |
Returns a new instance of DateTime class that represents the date and time value represented by the current object as UTC.
time_t System::DateTime::ToUnixTime | ( | ) | const |
Returns a value that represents the date and time value represented by the current object as Unix time. FOR INTERNAL USE.
|
static |
Converts the specified string representation of a date and time value to the equivalent DateTime object.
s | The string representation of a date and time value to convert. |
result | The output argument that, if the conversion succeeds, contains the result of conversion. |
|
static |
Converts the specified string representation of a date and time value to the equivalent DateTime object using the specified culture-specific format information and style.
s | The string representation of a date and time value to convert. |
provider | The IFormatProvider object that provides culture-specific format information. |
styles | A bitwise combination of the enumeration values that provides additional information about s , about style elements that may be present in s , or about the conversion from s to a DateTime object. |
result | The output argument that, if the conversion succeeds, contains the result of conversion. |
|
static |
|
static |
|
static |
|
static |
Converts the specified string representation of a date and time value to the equivalent DateTime object using the specified format, culture-specific format information and style. The format of the string representation must match the specified format exactly.
s | The string representation of a date and time value to convert. |
format | The string format. |
provider | The IFormatProvider object that provides culture-specific format information. |
styles | A bitwise combination of the enumeration values that provides additional information about s , about style elements that may be present in s , or about the conversion from s to a DateTime object. |
result | The output argument that, if the conversion succeeds, contains the result of conversion. |
|
static |
|
static |
|
static |
|
static |
Converts the specified string representation of a date and time value to the equivalent DateTime object using the specified formats, culture-specific format information and style. The format of the string representation must match one or more of the specified formats exactly.
s | The string representation of a date and time value to convert. |
formats | The array of string formats. |
provider | The IFormatProvider object that provides culture-specific format information. |
styles | A bitwise combination of the enumeration values that provides additional information about s , about style elements that may be present in s , or about the conversion from s to a DateTime object. |
result | The output argument that, if the conversion succeeds, contains the result of conversion. |
|
static |
|
static |
|
static |
|
inlinestatic |
Returns a TypeInfo object that contains information about this class.
|
static |
The number of 100-nanosecond in the time interval between the minimal possible and maximal possible DateTime value.
|
static |
An instance of DateTime class that represents the maximal possible date and time value.
|
static |
The minimal number of ticks that an instance of DateTime class can represent.
|
static |
An instance of DateTime class that represents the minimal possible date and time value.
|
static |
The number of ticks in a day.
|
static |
The number of ticks in a hour.
|
static |
The number of ticks in a microsecond.
|
static |
The number of ticks in a millisecond.
|
static |
The number of ticks in a minute.
|
static |
The number of ticks in a second.