Aspose::Cells::Duration struct

Duration struct

Represents a time interval with a resolution of 100 nanoseconds (tick).

struct Duration

Methods

MethodDescription
Duration(int64_t v)Initializes a new instance from a tick value.
Duration(int hours, int minutes, int seconds)Initializes a new instance from hours, minutes, and seconds.
Duration(int days, int hours, int minutes, int seconds)Initializes a new instance from days, hours, minutes, and seconds.
Duration(int days, int hours, int minutes, int seconds, int milliseconds)Initializes a new instance from days, hours, minutes, seconds, and milliseconds.
static FromDays(double value)Creates a Duration from a specified number of days.
static FromMilliseconds(double value)Creates a Duration from a specified number of milliseconds.
static FromMinutes(double value)Creates a Duration from a specified number of minutes.
static FromSeconds(double value)Creates a Duration from a specified number of seconds.
static FromTicks(int64_t value)Creates a Duration from a specified number of ticks.
GetDays() constGets the day component of the time interval.
GetHours() constGets the hour component (0-23).
GetMilliseconds() constGets the millisecond component (0-999).
GetMinutes() constGets the minute component (0-59).
GetSeconds() constGets the second component (0-59).
GetTicks() constGets the total number of ticks represented by this instance.
GetTotalDays() constGets the total number of days represented by this instance.
GetTotalHours() constGets the total number of hours represented by this instance.
GetTotalMilliseconds() constGets the total number of milliseconds represented by this instance.
GetTotalMinutes() constGets the total number of minutes represented by this instance.
GetTotalSeconds() constGets the total number of seconds represented by this instance.
operator!=(const Duration& ts) constDetermines whether two Duration instances are not equal.
operator*(double factor) constMultiplies the time interval by a scalar factor.
operator+(const Duration& ts) constAdds two time intervals.
operator+() constReturns the current instance (unary plus).
operator-(const Duration& ts) constSubtracts one time interval from another.
operator-() constReturns a new Duration whose value is the negation of the current instance.
operator/(const Duration& ts) constReturns the ratio between two time intervals.
operator/(double divisor) constDivides the time interval by a scalar value.
operator<(const Duration& ts) constDetermines whether the current instance is less than another.
operator<=(const Duration& ts) constDetermines whether the current instance is less than or equal to another.
operator==(const Duration& ts) constDetermines whether two Duration instances are equal.
operator>(const Duration& ts) constDetermines whether the current instance is greater than another.
operator>=(const Duration& ts) constDetermines whether the current instance is greater than or equal to another.

Fields

FieldDescription
valueInternal representation of the time interval in ticks. 1 tick = 100 nanoseconds.

See Also