Duration StructureDuration StructureDuration Structure

Represents a duration of time that is expressed by the Gregorian year, month, day, hour, minute and second components. The corresponding XML Schema type is xs:duration.

Syntax

Public NotInheritable  Duration _
        Implements IEquatable(Of Duration)
public sealed  Duration : IEquatable<Duration>
public:
value class Duration sealed : IEquatable<Duration>
 
The DurationDurationDuration type exposes the following members.

Constructors

Top

Properties

 PropertyDescription
Public propertyDaysDaysDays Gets the days component of the current DurationDurationDuration.
Public propertyDayTimeDurationDayTimeDurationDayTimeDuration Returns a DayTimeDurationDayTimeDurationDayTimeDuration representing the days, hours, minutes and seconds in this duration
Public propertyHoursHoursHours Gets the hours component of the current DurationDurationDuration.
Public propertyMinutesMinutesMinutes Gets the minutes component of the current DurationDurationDuration.
Public propertyMonthsMonthsMonths Gets the months component of the current DurationDurationDuration.
Public propertySecondsSecondsSeconds Gets the seconds component of the current DurationDurationDuration.
Public propertyYearMonthDurationYearMonthDurationYearMonthDuration Returns a YearMonthDurationYearMonthDurationYearMonthDuration representing the years and months in this duration
Public propertyYearsYearsYears Gets the years component of the current DurationDurationDuration.

Top

Methods

 MethodDescription
Public methodstaticAddAddAdd Adds two specified DurationDurationDuration values.
Public methodstaticDivideDivideDivide Divides the specified DurationDurationDuration value by a doubleDoubledouble value.
Public methodEquals (object)Equals (Object)Equals (object^) Determines whether this instance is equal to a specified object. (Overrides ValueType.EqualsValueType.EqualsValueType::Equals)
Public methodEquals (Duration)Equals (Duration)Equals (Duration) Indicates whether this instance is equal to another DurationDurationDuration.
Protected methodObject.FinalizeObject.FinalizeObject::Finalize Allows an objectObjectobject to attempt to free resources and perform other cleanup operations before the objectObjectobject is reclaimed by garbage collection. (Inherited from System.ObjectSystem.ObjectSystem::Object)
Public methodGetHashCodeGetHashCodeGetHashCode Returns the hash code for this instance. (Overrides ValueType.GetHashCodeValueType.GetHashCodeValueType::GetHashCode)
Public methodObject.GetTypeObject.GetTypeObject::GetType Gets the TypeTypeType of the current instance. (Inherited from System.ObjectSystem.ObjectSystem::Object)
Protected methodObject.MemberwiseCloneObject.MemberwiseCloneObject::MemberwiseClone Creates a shallow copy of the current objectObjectobject. (Inherited from System.ObjectSystem.ObjectSystem::Object)
Public methodstaticMultiply (double, Duration)Multiply (Double, Duration)Multiply (double, Duration) Multiplies the specified DurationDurationDuration value by a doubleDoubledouble value.
Public methodstaticMultiply (Duration, double)Multiply (Duration, Double)Multiply (Duration, double) Multiplies the specified DurationDurationDuration value by a doubleDoubledouble value.
Public methodstaticNegateNegateNegate Negates the value of the specified DurationDurationDuration operand.
Public methodstaticParseParseParse Converts a lexical representation of an xs:duration to its DurationDurationDuration equivalent.
Public methodstaticPlusPlusPlus Returns the value of the DurationDurationDuration operand (the sign of the operand is unchanged).
Public methodstaticSubtractSubtractSubtract Subtracts a DurationDurationDuration value from another DurationDurationDuration value.
Public methodToStringToStringToString Returns the canonical lexical representation of this DurationDurationDuration. (Overrides ValueType.ToStringValueType.ToStringValueType::ToString)
Public methodstaticTryParseTryParseTryParse Converts a lexical representation of an xs:duration to its DurationDurationDuration equivalent. A return value indicates whether the conversion succeeded or failed.

Top

Operators

 OperatorDescription
Public operatorstaticAdditionAdditionAddition Adds two specified DurationDurationDuration values.
Public operatorstaticDivisionDivisionDivision Divides the specified DurationDurationDuration value by a doubleDoubledouble value.
Public operatorstaticEqualityEqualityEquality Indicates whether a specified DurationDurationDuration is equal to another specified DurationDurationDuration.
Public operatorstaticInequalityInequalityInequality Indicates whether a specified DurationDurationDuration is not equal to another specified DurationDurationDuration.
Public operatorstaticMultiply (double, Duration)Multiply (Double, Duration)Multiply (double, Duration) Multiplies the specified DurationDurationDuration value by a doubleDoubledouble value.
Public operatorstaticMultiply (Duration, double)Multiply (Duration, Double)Multiply (Duration, double) Multiplies the specified DurationDurationDuration value by a doubleDoubledouble value.
Public operatorstaticSubtractionSubtractionSubtraction Subtracts a DurationDurationDuration value from another DurationDurationDuration value.
Public operatorstaticUnaryNegationUnaryNegationUnaryNegation Negates the value of the specified DurationDurationDuration operand.
Public operatorstaticUnaryPlusUnaryPlusUnaryPlus Returns the value of the DurationDurationDuration operand (the sign of the operand is unchanged).

Top

Fields

 FieldDescription
Public fieldstaticMaxValueMaxValueMaxValue Represents the maximum DurationDurationDuration value. This field is read-only.
Public fieldstaticMinValueMinValueMinValue Represents the minimum DurationDurationDuration value. This field is read-only.

Top

Remarks

A DurationDurationDuration is a duration of time that is expressed by the Gregorian year, month, day, hour, minute and second components. Note that the order relation on DurationDurationDuration is a partial order For example, the order of the durations one month (P1M) and 30 days (P30D) cannot be determined.