Search
Duration Members
Constructors Fields Methods
 


Represents an immutable time interval.

The following tables list the members exposed by the Duration type.

 Public Constructors

  Name Description

Duration

Overloaded.  

 Public Fields

  Name Description

MaxValue

Represents the largest possible value of Duration.

MinValue

Represents the smallest possible value of Duration.

TicksPerDay

Represents the number of ticks in 1 day.

TicksPerHour

Represents the number of ticks in 1 hour.

TicksPerMillisecond

Represents the number of ticks in 1 millisecond.

TicksPerMinute

Represents the number of ticks in 1 minute.

TicksPerSecond

Represents the number of ticks in 1 second.

Zero

Represents zero duration.

 Public Methods

  Name Description

add

Returns a new Duration object whose value is the sum of the specified Duration object and this instance.

clone

Cloneable.clone implementation.

compareTo

Comparable.compareTo implementation.

equals

Object.equals override.

fromDays

Overloaded.  

fromHours

Overloaded.  

fromMilliseconds

Overloaded.  

fromMinutes

Overloaded.  

fromSeconds

Overloaded.  

fromTicks

Returns a Duration that represents a specified time, where the specification is in units of ticks.

getDays

Gets the days component of the time interval represented by the current Duration object.

getHours

Gets the hours component of the time interval represented by the current Duration object.

getMilliseconds

Gets the milliseconds component of the time interval represented by the current Duration object.

getMinutes

Gets the minutes component of the time interval represented by the current Duration object.

getSeconds

Gets the seconds component of the time interval represented by the current Duration object.

getTicks

Gets the number of ticks that represent the value of the current Duration object.

getTotalDays

Gets the value of the current Duration object expressed in whole days.

getTotalHours

Gets the value of the current Duration expressed in whole and fractional hours.

getTotalMilliseconds

Gets the total number of milliseconds in this instance.

getTotalMinutes

Gets the value of the current Duration expressed in whole and fractional minutes.

getTotalSeconds

Gets the value of the current Duration object expressed in whole and fractional seconds.

hashCode

Object.hashCode override.

negate

Returns a Duration whose value is the negated value of the specified instance.

op_Addition

Adds two specified Duration instances.

op_Equality

Indicates whether two Duration instances are equal.

op_GreaterThan

Indicates whether a specified Duration is greater than another specified Duration.

op_GreaterThanOrEqual

Indicates whether a specified Duration is greater than or equal to another specified Duration.

op_Inequality

Indicates whether two Duration instances are not equal.

op_LessThan

Indicates whether a specified Duration is less than another specified Duration.

op_LessThanOrEqual

Indicates whether a specified Duration is less than or equal to another specified Duration.

op_Subtraction

Subtracts a specified Duration from another specified Duration.

op_UnaryNegation

Returns a Duration whose value is the negated value of the specified instance.

subtract

Returns a new Duration object whose value is the difference between the specified Duration object and this instance.

toJavaDuration

Returns the stored java.time.Duration.

toString

Returns the string representation of the value of this instance.

 See Also