Public Member Functions | |
constexpr | TimeSpan () |
Constructs a TimeSpan object that represents a zero time interval. More... | |
constexpr | TimeSpan (int64_t ticks) |
ASPOSECPP_SHARED_API | TimeSpan (int hours, int minutes, int seconds) |
ASPOSECPP_SHARED_API | TimeSpan (int days, int hours, int minutes, int seconds, int milliseconds=0) |
constexpr | TimeSpan (const TimeSpan &)=default |
Constructs a TimeSpan object that represents the time interval equal to the time interval represented by the specified TimeSpan object. More... | |
constexpr TimeSpan & | operator= (const TimeSpan &)=default |
constexpr int | CompareTo (TimeSpan value) const |
ASPOSECPP_SHARED_API int | CompareTo (const SharedPtr< Object > &obj) const |
constexpr bool | Equals (TimeSpan value) const |
ASPOSECPP_SHARED_API bool | Equals (const SharedPtr< Object > &obj) const |
ASPOSECPP_SHARED_API int | GetHashCode () const |
Returns a hash code for the current object. More... | |
constexpr int | get_Days () const |
Returns the days component of the time interval represented by the current TimeSpan object. More... | |
constexpr int | get_Hours () const |
Returns the hours component of the time interval represented by the current TimeSpan object. More... | |
constexpr int | get_Minutes () const |
Returns the minutes component of the time interval represented by the current TimeSpan object. More... | |
constexpr int | get_Seconds () const |
Returns the seconds component of the time interval represented by the current TimeSpan object. More... | |
constexpr int | get_Milliseconds () const |
Returns the milliseconds component of the time interval represented by the current TimeSpan object. More... | |
constexpr int64_t | get_Ticks () const |
Returns the number of 100-nanoseconds intervals that constitute the time interval represented by the current TimeSpan object. More... | |
constexpr double | get_TotalDays () const |
Returns the value of the current TimeSpan object expressed in whole and fractional days. More... | |
constexpr double | get_TotalHours () const |
Returns the value of the current TimeSpan object expressed in whole and fractional hours. More... | |
constexpr double | get_TotalMinutes () const |
Returns the value of the current TimeSpan object expressed in whole and fractional minutes. More... | |
constexpr double | get_TotalSeconds () const |
Returns the value of the current TimeSpan object expressed in whole and fractional seconds. More... | |
ASPOSECPP_SHARED_API double | get_TotalMilliseconds () const |
Returns the value of the current TimeSpan object expressed in whole and fractional milliseconds. More... | |
ASPOSECPP_SHARED_API TimeSpan | Add (TimeSpan value) const |
ASPOSECPP_SHARED_API TimeSpan | Subtract (TimeSpan value) const |
ASPOSECPP_SHARED_API TimeSpan | Negate () const |
Returns a new instance of TimeSpan object that represents negated value represented by the current TimeSpan object. More... | |
ASPOSECPP_SHARED_API TimeSpan | Duration () const |
Returns a new instance of TimeSpan object whose value is the absolute value of the current object. More... | |
ASPOSECPP_SHARED_API String | ToString () const |
Returns the string representation of the time interval represented by the current object. More... | |
ASPOSECPP_SHARED_API String | ToString (const String &format) const |
Converts the value of the current object to equivalent string representation, using the specified format. More... | |
ASPOSECPP_SHARED_API String | ToString (const String &format, const SharedPtr< IFormatProvider > &provider) const |
Converts the value of the current object to equivalent string representation, using the specified format and format provider. More... | |
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 |
TimeSpan | operator+ (TimeSpan value) const |
TimeSpan & | operator+= (TimeSpan value) |
TimeSpan | operator- (TimeSpan value) const |
TimeSpan & | operator-= (TimeSpan value) |
TimeSpan | operator- () const |
Returns a new instance of TimeSpan object that represents negated value represented by the current TimeSpan object. More... | |
TimeSpan | operator+ () const |
Returns self. More... | |
ASPOSECPP_SHARED_API TimeSpan | operator/ (double divisor) const |
TimeSpan & | operator/= (double divisor) |
constexpr double | operator/ (TimeSpan value) const |
constexpr bool | operator== (TimeSpan value) const |
constexpr bool | operator!= (TimeSpan value) const |
constexpr bool | operator< (TimeSpan value) const |
constexpr bool | operator<= (TimeSpan value) const |
constexpr bool | operator> (TimeSpan value) const |
constexpr bool | operator>= (TimeSpan 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 constexpr TimeSpan | FromTicks (int64_t ticks) |
static TimeSpan | FromMilliseconds (double value) |
static TimeSpan | FromSeconds (double value) |
static TimeSpan | FromMinutes (double value) |
static TimeSpan | FromHours (double value) |
static TimeSpan | FromDays (double value) |
static constexpr int | Compare (TimeSpan t1, TimeSpan t2) |
static constexpr bool | Equals (TimeSpan a, TimeSpan b) |
Returns true if the specified objects represent the same time interval, otherwise - false. More... | |
static ASPOSECPP_SHARED_API TimeSpan | Parse (const String &input) |
static ASPOSECPP_SHARED_API TimeSpan | Parse (const String &input, const SharedPtr< IFormatProvider > &provider) |
static ASPOSECPP_SHARED_API TimeSpan | Parse (const String &input, const SharedPtr< Globalization::CultureInfo > &culture) |
static ASPOSECPP_SHARED_API TimeSpan | Parse (const String &input, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi) |
static TimeSpan | Parse (const String &input, std::nullptr_t) |
static ASPOSECPP_SHARED_API TimeSpan | ParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, Globalization::TimeSpanStyles styles=Globalization::TimeSpanStyles::None) |
static ASPOSECPP_SHARED_API TimeSpan | ParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::TimeSpanStyles styles=Globalization::TimeSpanStyles::None) |
static ASPOSECPP_SHARED_API TimeSpan | ParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::TimeSpanStyles styles=Globalization::TimeSpanStyles::None) |
static ASPOSECPP_SHARED_API TimeSpan | ParseExact (const String &input, const ArrayPtr< String > &formats, std::nullptr_t, Globalization::TimeSpanStyles styles=Globalization::TimeSpanStyles::None) |
static ASPOSECPP_SHARED_API TimeSpan | ParseExact (const String &input, const String &format, const SharedPtr< IFormatProvider > &provider, Globalization::TimeSpanStyles styles=Globalization::TimeSpanStyles::None) |
static ASPOSECPP_SHARED_API TimeSpan | ParseExact (const String &input, const String &format, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::TimeSpanStyles styles=Globalization::TimeSpanStyles::None) |
static ASPOSECPP_SHARED_API TimeSpan | ParseExact (const String &input, const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::TimeSpanStyles styles=Globalization::TimeSpanStyles::None) |
static ASPOSECPP_SHARED_API TimeSpan | ParseExact (const String &input, const String &format, std::nullptr_t, Globalization::TimeSpanStyles styles=Globalization::TimeSpanStyles::None) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &input, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &input, const SharedPtr< IFormatProvider > &provider, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &input, const SharedPtr< Globalization::CultureInfo > &culture, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &input, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &input, std::nullptr_t, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< Globalization::CultureInfo > &culture, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const ArrayPtr< String > &formats, std::nullptr_t, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const String &format, const SharedPtr< IFormatProvider > &provider, Globalization::TimeSpanStyles styles, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const String &format, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::TimeSpanStyles styles, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::TimeSpanStyles styles, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const String &format, std::nullptr_t, Globalization::TimeSpanStyles styles, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< IFormatProvider > &provider, Globalization::TimeSpanStyles styles, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< Globalization::CultureInfo > &culture, Globalization::TimeSpanStyles styles, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const ArrayPtr< String > &formats, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, Globalization::TimeSpanStyles styles, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const ArrayPtr< String > &formats, std::nullptr_t, Globalization::TimeSpanStyles styles, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const String &format, const SharedPtr< IFormatProvider > &provider, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const String &format, const SharedPtr< Globalization::CultureInfo > &culture, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const String &format, const SharedPtr< Globalization::DateTimeFormatInfo > &dtfi, TimeSpan &result) |
static ASPOSECPP_SHARED_API bool | TryParseExact (const String &input, const String &format, std::nullptr_t, TimeSpan &result) |
static const TypeInfo & | Type () |
Returns a TypeInfo object that represent TimeSpan structure. More... | |
Static Public Attributes | |
static ASPOSECPP_SHARED_API const TimeSpan | Zero |
The TimeSpan object that represents zero-interval. More... | |
static ASPOSECPP_SHARED_API const TimeSpan | MaxValue |
The TimeSpan object that represents the longest possible interval. More... | |
static ASPOSECPP_SHARED_API const TimeSpan | MinValue |
/// The TimeSpan object that represents the shortest possible interval. More... | |
static constexpr int64_t | TicksPerDay = 864000000000ULL |
The number of 100-nanoseconds intervals in a day (24-hour interval). More... | |
static constexpr int64_t | TicksPerHour = 36000000000ULL |
The number of 100-nanoseconds intervals in a hour. More... | |
static constexpr int64_t | TicksPerMillisecond = 10000ULL |
The number of 100-nanoseconds intervals in a millisecond. More... | |
static constexpr int64_t | TicksPerMinute = 600000000ULL |
The number of 100-nanoseconds intervals in a minute. More... | |
static constexpr int64_t | TicksPerSecond = 10000000ULL |
The number of 100-nanoseconds intervals in a second. More... | |
Represents a time interval. 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 a TimeSpan object that represents a zero time interval.
|
inlineexplicit |
Constructs an instance of TimeSpan class that represents the specified time interval.
ticks | The time interval to be represented by the instance being constructed expressed as the number of 100-nanoseconds intervals. |
ASPOSECPP_SHARED_API System::TimeSpan::TimeSpan | ( | int | hours, |
int | minutes, | ||
int | seconds | ||
) |
Constructs an instance of TimeSpan class that represents the time interval which is equal to the sum of the specified number of hours, minutes and seconds.
hours | The number of hours in the hours component of the time interval to be represented by the instance being constructed |
minutes | The number of minutes in the minutes component of the time interval to be represented by the instance being constructed |
seconds | The number of seconds in the seconds component of the time interval to be represented by the instance being constructed |
ASPOSECPP_SHARED_API System::TimeSpan::TimeSpan | ( | int | days, |
int | hours, | ||
int | minutes, | ||
int | seconds, | ||
int | milliseconds = 0 |
||
) |
Constructs an instance of TimeSpan class that represents the time interval which is equal to the sum of the specified number of hours, minutes, seconds and milliseconds.
days | The number of days in the days component of the time interval to be represented by the instance being constructed |
hours | The number of hours in the hours component of the time interval to be represented by the instance being constructed |
minutes | The number of minutes in the minutes component of the time interval to be represented by the instance being constructed |
seconds | The number of seconds in the seconds component of the time interval to be represented by the instance being constructed |
milliseconds | The number of milliseconds in the milliseconds component of the time interval to be represented by the instance being constructed |
|
default |
Returns a new instance of TimeSpan class that represents a time interval which is the sum of the time intervals represented by the current and the specified objects.
value | The TimeSpan object that represents the time interval to add |
Compares two TimeSpan objects.
t1 | The first comparand |
t2 | The second comparand |
t1
is shorter than t2
; 0 if t1
is equal to t2
; 1 if t1
is longer than t2
|
inline |
Compares current and the specified objects.
value | The TimeSpan object to compare the current object with |
value
; 0 if the current object represents the interval that is equal to value
; 1 if the current object represents the interval that is longer than value
Compares current and the specified objects.
obj | The TimeSpan object to compare the current object with |
value
; 0 if the current object represents the interval that is equal to value
; 1 if the current object represents the interval that is longer than value
ASPOSECPP_SHARED_API TimeSpan System::TimeSpan::Duration | ( | ) | const |
Returns a new instance of TimeSpan object whose value is the absolute value of the current object.
|
inline |
Determines if the time interval represented by the current object is equal to the time interval represented by the specified object.
value | The TimeSpan object to compare the current object with |
Determines if the time interval represented by the current object is equal to the time interval represented by the specified object.
obj | The TimeSpan object to compare the current object with |
Returns true if the specified objects represent the same time interval, otherwise - false.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Returns the days component of the time interval represented by the current TimeSpan object.
|
inline |
Returns the hours component of the time interval represented by the current TimeSpan object.
|
inline |
Returns the milliseconds component of the time interval represented by the current TimeSpan object.
|
inline |
Returns the minutes component of the time interval represented by the current TimeSpan object.
|
inline |
Returns the seconds component of the time interval represented by the current TimeSpan object.
|
inline |
Returns the number of 100-nanoseconds intervals that constitute the time interval represented by the current TimeSpan object.
|
inline |
Returns the value of the current TimeSpan object expressed in whole and fractional days.
|
inline |
Returns the value of the current TimeSpan object expressed in whole and fractional hours.
ASPOSECPP_SHARED_API double System::TimeSpan::get_TotalMilliseconds | ( | ) | const |
Returns the value of the current TimeSpan object expressed in whole and fractional milliseconds.
|
inline |
Returns the value of the current TimeSpan object expressed in whole and fractional minutes.
|
inline |
Returns the value of the current TimeSpan object expressed in whole and fractional seconds.
ASPOSECPP_SHARED_API int System::TimeSpan::GetHashCode | ( | ) | const |
Returns a hash code for the current object.
|
inline |
ASPOSECPP_SHARED_API TimeSpan System::TimeSpan::Negate | ( | ) | const |
|
inline |
Determines if the time interval represented by the current object is not equal to the time interval represented by the specified object.
value | The TimeSpan object to compare the current object with |
|
inline |
Returns a new instance of TimeSpan class that represents a time interval which is the sum of the time intervals represented by the current and the specified objects.
value | The TimeSpan object that represents the time interval to add |
|
inline |
Returns self.
Assigns to the current object the time interval which is the sum of the time interval represented by the current and the specified objects.
value | The TimeSpan object that represents the time interval to add |
Returns a new instance of TimeSpan class that represents a time interval which is the result of subtraction of the time interval represented by the specified object from the time interval represented by the current object.
value | The TimeSpan object that represents the time interval to subtract |
|
inline |
Assigns to the current object the time interval which is the result of subtraction of the time interval represented by the specified object from the time interval represented by the current object.
value | The TimeSpan object that represents the time interval to subtract |
ASPOSECPP_SHARED_API TimeSpan System::TimeSpan::operator/ | ( | double | divisor | ) | const |
|
inline |
|
inline |
|
inline |
Determines if the time interval represented by the current object is shorter than the time interval represented by the specified object.
value | The TimeSpan object to compare the current object with |
value
, otherwise - false
|
inline |
|
inline |
Determines if the time interval represented by the current object is shorter than or equal to the time interval represented by the specified object.
value | The TimeSpan object to compare the current object with |
value
, otherwise - false
|
inline |
|
inline |
Determines if the time interval represented by the current object is equal to the time interval represented by the specified object.
value | The TimeSpan object to compare the current object with |
|
inline |
|
inline |
Determines if the time interval represented by the current object is longer than the time interval represented by the specified object.
value | The TimeSpan object to compare the current object with |
value
, otherwise - false
|
inline |
|
inline |
Determines if the time interval represented by the current object is longer than or equal to the time interval represented by the specified object.
value | The TimeSpan object to compare the current object with |
value
, otherwise - false
|
inline |
Converts string to equivalent TimeSpan object.
input | Input string. |
|
static |
Converts string to equivalent TimeSpan object using the specified format provider.
input | Input string. |
provider | Format provider that supplies culture-specific formatting information. |
|
static |
|
static |
|
static |
Converts string to equivalent TimeSpan object using the specified formats, format provider and styles.
input | Input string. |
formats | Array of format strings. |
provider | Format provider that supplies culture-specific formatting information. |
styles | Defines elements that may be present in input string. |
|
static |
|
static |
|
static |
|
static |
Converts string to equivalent TimeSpan object using the specified format, format provider and styles.
input | Input string. |
format | Standard or custom format string. |
provider | Format provider that supplies culture-specific formatting information. |
styles | Defines elements that may be present in input string. |
|
static |
|
static |
|
static |
Returns a new instance of TimeSpan class that represents a time interval which is the result of subtraction of the time interval represented by the specified object from the time interval represented by the current object.
value | The TimeSpan object that represents the time interval to subtract |
ASPOSECPP_SHARED_API String System::TimeSpan::ToString | ( | ) | const |
Returns the string representation of the time interval represented by the current object.
Converts the value of the current object to equivalent string representation, using the specified format.
ASPOSECPP_SHARED_API String System::TimeSpan::ToString | ( | const String & | format, |
const SharedPtr< IFormatProvider > & | provider | ||
) | const |
Converts the value of the current object to equivalent string representation, using the specified format and format provider.
ASPOSECPP_SHARED_API String System::TimeSpan::ToString | ( | const String & | format, |
const SharedPtr< Globalization::CultureInfo > & | culture | ||
) | const |
ASPOSECPP_SHARED_API String System::TimeSpan::ToString | ( | const String & | format, |
const SharedPtr< Globalization::DateTimeFormatInfo > & | dtfi | ||
) | const |
|
static |
Converts string to equivalent TimeSpan object and returns result of conversion.
input | Input string. |
result | Time interval that corresponds to string. |
|
static |
Converts string to equivalent TimeSpan object using the specified format provider and returns result of conversion.
input | Input string. |
provider | Format provider that supplies culture-specific formatting information. |
result | Time interval that corresponds to string. |
|
static |
|
static |
|
static |
|
static |
Converts string to equivalent TimeSpan object using the specified formats and format provider, and returns result of conversion.
input | Input string. |
formats | Array of format strings. |
provider | Format provider that supplies culture-specific formatting information. |
result | Time interval that corresponds to string. |
|
static |
|
static |
|
static |
|
static |
Converts string to equivalent TimeSpan object using the specified format, format provider and styles, and returns result of conversion.
input | Input string. |
format | Standard or custom format string. |
provider | Format provider that supplies culture-specific formatting information. |
styles | Defines elements that may be present in input string. |
result | Time interval that corresponds to string. |
|
static |
|
static |
|
static |
|
static |
Converts string to equivalent TimeSpan object using the specified formats, format provider and styles, and returns result of conversion.
input | Input string. |
formats | Array of format strings. |
provider | Format provider that supplies culture-specific formatting information. |
styles | Defines elements that may be present in input string. |
result | Time interval that corresponds to string. |
|
static |
|
static |
|
static |
|
static |
Converts string to equivalent TimeSpan object using the specified format and format provider, and returns result of conversion.
input | Input string. |
format | Standard or custom format string. |
provider | Format provider that supplies culture-specific formatting information. |
result | Time interval that corresponds to string. |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
The TimeSpan object that represents the longest possible interval.
|
static |
/// The TimeSpan object that represents the shortest possible interval.
|
static |
The number of 100-nanoseconds intervals in a day (24-hour interval).
|
static |
The number of 100-nanoseconds intervals in a hour.
|
static |
The number of 100-nanoseconds intervals in a millisecond.
|
static |
The number of 100-nanoseconds intervals in a minute.
|
static |
The number of 100-nanoseconds intervals in a second.