Duration Methods

Methods

Compare Compares two Duration values and returns an integer that indicates their relationship
CompareTo Compares this instance to a specified object and returns an indication of their relative values
Equals(Object) This is overridden to allow proper comparison of Duration objects
(Overrides ValueType.Equals(Object))
Equals(Duration, Duration) Returns a value indicating whether two specified instances of Duration are equal
FromMonths Returns a Duration that represents a specified number of months, where the specification is accurate to the nearest millisecond.
FromWeeks Returns a Duration that represents a specified number of weeks, where the specification is accurate to the nearest millisecond.
FromYears Returns a Duration that represents a specified number of years, where the specification is accurate to the nearest millisecond.
GetHashCode Get a hash code for the duration object
(Overrides ValueType.GetHashCode())
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToDescription() Convert the duration instance to a text description
ToDescription(Duration.MaxUnit) Convert the duration instance to a text description with the specified maximum unit of time
ToString() Convert the duration instance to its ISO 8601 string form
(Overrides ValueType.ToString())
ToString(Duration.MaxUnit) Convert the duration instance to its ISO 8601 string form with the specified maximum unit of time
TryParse Construct a new Duration object from a duration specified in a string. Parameters specify the duration and the variable where the new Duration object is returned.

See Also