Click or drag to resize

Duration Methods

The Duration type exposes the following members.

Methods
  NameDescription
Public methodAdd
Adds the specified Duration to this instance.
Public methodAddDays
Adds a specified number of days to this Duration and returns the new Duration.
Public methodAddSeconds
Adds a specified number of seconds to this Duration and returns the new Duration.
Public methodCompareTo(Duration)
Compares this instance with another instance of the same type.
Public methodCompareTo(Object)
Compares this instance with another instance of the same type.
Public methodDivide(Double)
Divides the Duration by a constant.
Public methodDivide(Duration)
Divides the Duration by another Duration, yield a constant.
Public methodEquals(Duration)
Returns if this Duration exactly equals another Duration, within the limits of floating point precision. To be considered equal, the Days and Standard properties must be identical (or one must be null) and the difference between the Seconds properties must be less than 1.0e-10.
Public methodEquals(Object)
Returns if this Duration exactly equals another Duration, within the limits of floating point precision. To be considered equal, the Days and Standard properties must be identical (or one must be null) and the difference between the Seconds properties must be less than 1.0e-10.
(Overrides ValueTypeEquals(Object).)
Public methodEqualsEpsilon
Returns if this Duration is within epsilon seconds of the specified Duration. That is, in order for the Durations to be considered equal (and for this function to return ), the absolute value of the difference between them, in seconds, must be less than or equal to epsilon.
Public methodStatic memberFromDays(Double)
Returns a Duration that represents the specified number of days.
Public methodStatic memberFromDays(Double, TimeStandard)
Returns a Duration that represents the specified number of days using the specified time standard.
Public methodStatic memberFromHours(Double)
Returns a Duration that represents the specified number of hours.
Public methodStatic memberFromHours(Double, TimeStandard)
Returns a Duration that represents the specified number of hours using the specified time standard.
Public methodStatic memberFromMinutes(Double)
Returns a Duration that represents the specified number of minutes.
Public methodStatic memberFromMinutes(Double, TimeStandard)
Returns a Duration that represents the specified number of minutes using the specified time standard.
Public methodStatic memberFromSeconds(Double)
Returns a Duration that represents the specified number of seconds.
Public methodStatic memberFromSeconds(Double, TimeStandard)
Returns a Duration that represents the specified number of seconds using the specified time standard.
Public methodGetHashCode
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberHoursMinutesSecondsToSeconds
Converts the specified number of hours, minutes, and seconds to total duration in seconds.
Public methodMultiply
Multiplies the Duration by a constant.
Public methodSubtract
Subtracts the specified Duration from this instance.
Public methodToString
Returns the value of the Duration in Days:Seconds.
(Overrides ValueTypeToString.)
Public methodToTimeSpan
Returns a TimeSpan equivalent to this Duration.
Top
See Also