CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
|
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. More...
#include <date_time.h>
Public Member Functions | |
constexpr | DateTime () |
Constructs an instance that represents the smallest possible date and time value equal to MinValue. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
DateTime (int64_t ticks, DateTimeKind kind=DateTimeKind::Unspecified) | |
Construct an instance that represents a date and time value specified as a number of ticks. More... | |
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. More... | |
DateTime (const DateTime &dt)=default | |
Copy-constructs an instance. More... | |
DateTime & | operator= (const DateTime &dt)=default |
Assigns the value represented by the specified DateTime instance to the current object. More... | |
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... | |
int | get_DayOfYear () const |
Returns the ordinal number of the day in the year represented by the current object. More... | |
int | get_Year () const |
Returns the year represented by the current object. More... | |
int | get_Month () const |
Returns the ordinal number of the month in the year represented by the current object. More... | |
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... | |
DateTime | Add (TimeSpan value) const |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
DateTime | Subtract (TimeSpan duration) const |
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. More... | |
constexpr TimeSpan | Subtract (DateTime value) const |
Returns an instance of TimeSpan class representing the time interval between the date and time values represented by the current and the specified objects. More... | |
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... | |
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... | |
int64_t | ToFileTime () const |
Returns a value that represents the date and time value represented by the current object as File time. More... | |
int64_t | ToFileTimeUtc () const |
Converts the date and time value represented by the current object to File time UTC. More... | |
int64_t | ToBinary () const |
Serializes the current object. More... | |
double | ToOADate () const |
Returns the date and time value represented by the current object as OLE Automation Date. More... | |
bool | 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. More... | |
constexpr int | CompareTo (DateTime value) const |
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. More... | |
constexpr bool | Equals (DateTime other) const |
Determines if the specified instance of DateTime class represent the same date and time value as the current object. More... | |
int | GetHashCode () const |
Returns a hash code for the current object. More... | |
String | 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. More... | |
String | ToString (const String &format) const |
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. More... | |
String | 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. More... | |
String | ToString (const SharedPtr< Globalization::CultureInfo > &culture) const |
String | ToString (const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi) const |
String | ToString (std::nullptr_t) const |
String | 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. More... | |
String | ToString (const String &format, const SharedPtr< Globalization::CultureInfo > &culture) const |
String | ToString (const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi) const |
String | ToString (const String &format, std::nullptr_t) const |
String | ToShortDateString () const |
Returns a string that contains the short date string representation of the current object. More... | |
String | ToLongDateString () const |
Returns a string that contains the long date string representation of the current object. More... | |
String | ToShortTimeString () const |
Returns a string that contains the short time string representation of the current object. More... | |
String | ToLongTimeString () const |
Returns a string that contains the long time string representation of the current object. More... | |
ArrayPtr< String > | GetDateTimeFormats () 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. More... | |
ArrayPtr< String > | GetDateTimeFormats (char_t format) 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. More... | |
ArrayPtr< String > | 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. More... | |
ArrayPtr< String > | 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. More... | |
constexpr bool | operator== (DateTime other) const |
Determines if the current object and the specified DateTime object represent the same date and time value. More... | |
constexpr bool | operator!= (DateTime other) const |
Determines if the current object and the specified DateTime object represent distinct date and time values. More... | |
constexpr bool | operator< (DateTime other) const |
Determines if the current object represents the date and time value that is earlier than the value represented by the specified DateTime object. More... | |
constexpr bool | operator<= (DateTime 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 DateTime object. More... | |
constexpr bool | operator> (DateTime other) const |
Determines if the current object represents the date and time value that is later than the value represented by the specified DateTime object. More... | |
constexpr bool | operator>= (DateTime 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 DateTime object. More... | |
DateTime | operator+ (TimeSpan value) const |
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. More... | |
DateTime | operator- (TimeSpan value) const |
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. More... | |
DateTime & | operator+= (TimeSpan 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. More... | |
DateTime & | operator-= (TimeSpan 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. More... | |
constexpr TimeSpan | operator- (DateTime value) 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. More... | |
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 DateTime | get_Now () |
Returns an instance of DateTime class that represents the current time as local time. More... | |
static DateTime | get_UtcNow () |
Returns an instance of DateTime class that represents the current time as UTC. More... | |
static 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 DateTime | FromBinary (int64_t value) |
Deserializes the date time value from the specified unsigned 64-bit integer and sets the new instance of DateTime class to that value. More... | |
static DateTime | FromFileTimeUtc (int64_t file_time) |
Converts the specified File time to an instance of DateTime class representing the same date and time value as UTC time. More... | |
static DateTime | FromOADate (double date) |
Returns an instance of DateTime class representing the date and time value equivalent to the specified OLE Automation Date. More... | |
static DateTime | FromUnixTime (time_t value) |
Converts the specified Unix time value to an instance of DateTime class. FOR INTERNAL USE. More... | |
static DateTime | FromFileTime (int64_t value) |
Converts the specified File time to an instance of DateTime class representing the same date and time value as local time. More... | |
static int | DaysInMonth (int year, int month) |
Returns the number of days in the specified month of the specified year. More... | |
static bool | IsLeapYear (int year) |
Determines of the specified year is a leap year. More... | |
static DateTime | SpecifyKind (DateTime value, DateTimeKind kind) |
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 . More... | |
static constexpr int | Compare (DateTime t1, DateTime t2) |
Compares two values represented by the specified instances of DateTime class and returns the value indicating values' relative positions on the time line. More... | |
static constexpr bool | Equals (DateTime t1, DateTime t2) |
Determines if the specified instances of DateTime class represent the same date and time value. More... | |
static DateTime | Parse (const String &s) |
Converts the specified string representation of a date and time value to the equivalent DateTime object. More... | |
static DateTime | Parse (const String &s, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
Converts the specified string representation of a date and time value to the equivalent DateTime object using culture-specific format information. More... | |
static DateTime | Parse (const String &s, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static DateTime | Parse (const String &s, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static DateTime | Parse (const String &s, std::nullptr_t, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static DateTime | ParseExact (const String &s, const String &format, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
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. More... | |
static DateTime | ParseExact (const String &s, const String &format, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static DateTime | ParseExact (const String &s, const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static DateTime | ParseExact (const String &s, const String &format, std::nullptr_t, Globalization::DateTimeStyles styles=Globalization::DateTimeStyles::None) |
static DateTime | ParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles) |
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. More... | |
static DateTime | ParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles) |
static DateTime | ParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles) |
static DateTime | ParseExact (const String &s, const ArrayPtr< String > &formats, std::nullptr_t, Globalization::DateTimeStyles styles) |
static bool | TryParse (const String &s, DateTime &result) |
Converts the specified string representation of a date and time value to the equivalent DateTime object. More... | |
static bool | TryParse (const String &s, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTime &result) |
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. More... | |
static bool | TryParse (const String &s, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles, DateTime &result) |
static bool | TryParse (const String &s, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles, DateTime &result) |
static bool | TryParse (const String &s, std::nullptr_t, Globalization::DateTimeStyles styles, DateTime &result) |
static bool | TryParseExact (const String &s, const String &format, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTime &result) |
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. More... | |
static bool | TryParseExact (const String &s, const String &format, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles, DateTime &result) |
static bool | TryParseExact (const String &s, const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles, DateTime &result) |
static bool | TryParseExact (const String &s, const String &format, std::nullptr_t, Globalization::DateTimeStyles styles, DateTime &result) |
static bool | TryParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, Globalization::DateTimeStyles styles, DateTime &result) |
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. More... | |
static bool | TryParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::DateTimeStyles styles, DateTime &result) |
static bool | TryParseExact (const String &s, const ArrayPtr< String > &formats, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::DateTimeStyles styles, DateTime &result) |
static 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 const DateTime | MinValue |
An instance of DateTime class that represents the minimal possible date and time value. More... | |
static const DateTime | MaxValue |
An instance of DateTime class that represents the maximal possible date and time value. More... | |
static 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.
|
inlineconstexpr |
Constructs an instance that represents the smallest possible date and time value equal to MinValue.
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. |
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 . |
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. |
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. |
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 . |
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. |
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 . |
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 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 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 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 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 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 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 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 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
|
inlineconstexpr |
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 |
|
inlineconstexpr |
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
|
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 |
|
inlineconstexpr |
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.
int System::DateTime::get_Day | ( | ) | const |
Returns the ordinal number of the day in the month represented by the current object.
|
inlineconstexpr |
Returns a value representing a day of week that is represented by the current object.
int System::DateTime::get_DayOfYear | ( | ) | const |
Returns the ordinal number of the day in the year represented by the current object.
|
inlineconstexpr |
Returns the hour component of the date and time value represented by the current object.
|
inlineconstexpr |
Returns the value representing if the date and time represented by the current object is a local or UTC date and time or neither.
|
inlineconstexpr |
Returns the millisecond component of the date and time value represented by the current object.
|
inlineconstexpr |
Returns the minute component of the date and time value represented by the current object.
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.
|
inlineconstexpr |
Returns the second component of the date and time value represented by the current object.
|
inlineconstexpr |
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.
|
inlineconstexpr |
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.
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. |
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. |
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. |
int System::DateTime::GetHashCode | ( | ) | const |
Returns a hash code for the current object.
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 |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
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 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
. 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. 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 |
|
inlineconstexpr |
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
|
inlineconstexpr |
|
inlineconstexpr |
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
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
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
|
inlineconstexpr |
|
inlineconstexpr |
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
|
inlineconstexpr |
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 |
|
static |
|
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 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 |
|
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 |
|
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 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
. 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. int64_t System::DateTime::ToBinary | ( | ) | const |
Serializes the current object.
int64_t System::DateTime::ToFileTime | ( | ) | const |
Returns a value that represents the date and time value represented by the current object as File time.
int64_t System::DateTime::ToFileTimeUtc | ( | ) | const |
Converts the date and time value represented by the current object to File time UTC.
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.
String System::DateTime::ToLongDateString | ( | ) | const |
Returns a string that contains the long date string representation of the current object.
String System::DateTime::ToLongTimeString | ( | ) | const |
Returns a string that contains the long time string representation of the current object.
double System::DateTime::ToOADate | ( | ) | const |
Returns the date and time value represented by the current object as OLE Automation Date.
String System::DateTime::ToShortDateString | ( | ) | const |
Returns a string that contains the short date string representation of the current object.
String System::DateTime::ToShortTimeString | ( | ) | const |
Returns a string that contains the short time string representation of the current object.
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.
String System::DateTime::ToString | ( | const SharedPtr< Globalization::CultureInfo > & | culture | ) | const |
String System::DateTime::ToString | ( | const SharedPtr< Globalization::DateTimeFormatInfo > & | dtfi | ) | const |
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
. 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. String System::DateTime::ToString | ( | const String & | format, |
const SharedPtr< Globalization::CultureInfo > & | culture | ||
) | const |
String System::DateTime::ToString | ( | const String & | format, |
const SharedPtr< Globalization::DateTimeFormatInfo > & | dtfi | ||
) | const |
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
.
|
inline |
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 |
|
static |
|
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. |
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 |
|
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 |
|
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 |
|
inlinestatic |
Returns a TypeInfo object that contains information about this class.
|
staticconstexpr |
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.
|
staticconstexpr |
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.
|
staticconstexpr |
The number of ticks in a day.
|
staticconstexpr |
The number of ticks in a hour.
|
staticconstexpr |
The number of ticks in a microsecond.
|
staticconstexpr |
The number of ticks in a millisecond.
|
staticconstexpr |
The number of ticks in a minute.
|
staticconstexpr |
The number of ticks in a second.