Duration MethodsNoda Time
The Duration type exposes the following members.
Methods

  NameDescription
Public methodStatic memberAdd
Adds one duration to another. Friendly alternative to operator+().
Public methodCompareTo
Compares the current object with another object of the same type.
Public methodStatic memberDivide
Divides a duration by a number. Friendly alternative to operator/().
Public methodEquals(Object)
Determines whether the specified OnlineObject is equal to this instance.
(Overrides OnlineValueType Equals(Object).)
Public methodEquals(Duration)
Indicates whether the current object is equal to another object of the same type.
Public methodStatic memberFromHours
Returns a Duration that represents the given number of hours.
Public methodStatic memberFromMilliseconds
Returns a Duration that represents the given number of milliseconds.
Public methodStatic memberFromMinutes
Returns a Duration that represents the given number of minutes.
Public methodStatic memberFromSeconds
Returns a Duration that represents the given number of seconds.
Public methodStatic memberFromStandardDays
Returns a Duration that represents the given number of days, assuming a 'standard' 24-hour day.
Public methodStatic memberFromStandardWeeks
Returns a Duration that represents the given number of weeks, assuming a 'standard' week consisting of seven 24-hour days.
Public methodStatic memberFromTicks
Returns a Duration that represents the given number of ticks.
Public methodStatic memberFromTimeSpan
Returns a Duration that represents the same number of ticks as the given OnlineTimeSpan.
Public methodGetHashCode
Returns a hash code for this instance.
(Overrides OnlineValueType GetHashCode .)
Public methodMinus
Returns the result of subtracting another duration from this one, for a fluent alternative to operator-().
Public methodStatic memberMultiply(Int64, Duration)
Multiplies a duration by a number. Friendly alternative to operator*().
Public methodStatic memberMultiply(Duration, Int64)
Multiplies a duration by a number. Friendly alternative to operator*().
Public methodStatic memberNegate
Implements a friendly alternative to the unary negation operator.
Public methodPlus
Returns the result of adding another duration to this one, for a fluent alternative to operator+().
Public methodStatic memberSubtract
Subtracts one duration from another. Friendly alternative to operator-().
Public methodToString 
Returns a OnlineString that represents this instance.
(Overrides OnlineValueType ToString .)
Public methodToString(String, IFormatProvider)
Formats the value of the current instance using the specified pattern.
Public methodToTimeSpan
Returns a OnlineTimeSpan that represents the same number of ticks as this Duration.
Back to Top
See Also