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
Properties
| Property | Description | |
|---|---|---|
| DaysDaysDays | Gets the days component of the current DurationDurationDuration. | |
| DayTimeDurationDayTimeDurationDayTimeDuration | Returns a DayTimeDurationDayTimeDurationDayTimeDuration representing the days, hours, minutes and seconds in this duration | |
| HoursHoursHours | Gets the hours component of the current DurationDurationDuration. | |
| MinutesMinutesMinutes | Gets the minutes component of the current DurationDurationDuration. | |
| MonthsMonthsMonths | Gets the months component of the current DurationDurationDuration. | |
| SecondsSecondsSeconds | Gets the seconds component of the current DurationDurationDuration. | |
| YearMonthDurationYearMonthDurationYearMonthDuration | Returns a YearMonthDurationYearMonthDurationYearMonthDuration representing the years and months in this duration | |
| YearsYearsYears | Gets the years component of the current DurationDurationDuration. |
Methods
| Method | Description | |
|---|---|---|
| AddAddAdd | Adds two specified DurationDurationDuration values. | |
| DivideDivideDivide | Divides the specified DurationDurationDuration value by a doubleDoubledouble value. | |
| Equals (object)Equals (Object)Equals (object^) | Determines whether this instance is equal to a specified object. (Overrides ValueType.EqualsValueType.EqualsValueType::Equals) | |
| Equals (Duration)Equals (Duration)Equals (Duration) | Indicates whether this instance is equal to another DurationDurationDuration. | |
| Object.FinalizeObject.FinalizeObject::Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from System.ObjectSystem.ObjectSystem::Object) | |
| GetHashCodeGetHashCodeGetHashCode | Returns the hash code for this instance. (Overrides ValueType.GetHashCodeValueType.GetHashCodeValueType::GetHashCode) | |
| Object.GetTypeObject.GetTypeObject::GetType | Gets the type of the current instance.(Inherited from System.ObjectSystem.ObjectSystem::Object) | |
| Object.MemberwiseCloneObject.MemberwiseCloneObject::MemberwiseClone | Creates a shallow copy of the current objectObjectobject.(Inherited from System.ObjectSystem.ObjectSystem::Object) | |
| Multiply (double, Duration)Multiply (Double, Duration)Multiply (double, Duration) | Multiplies the specified DurationDurationDuration value by a doubleDoubledouble value. | |
| Multiply (Duration, double)Multiply (Duration, Double)Multiply (Duration, double) | Multiplies the specified DurationDurationDuration value by a doubleDoubledouble value. | |
| NegateNegateNegate | Negates the value of the specified DurationDurationDuration operand. | |
| ParseParseParse |
Converts a lexical representation of an xs:duration to its DurationDurationDuration
equivalent.
| |
| PlusPlusPlus | Returns the value of the DurationDurationDuration operand (the sign of the operand is unchanged). | |
| SubtractSubtractSubtract | Subtracts a DurationDurationDuration value from another DurationDurationDuration value. | |
| ToStringToStringToString | Returns the canonical lexical representation of this DurationDurationDuration. (Overrides ValueType.ToStringValueType.ToStringValueType::ToString) | |
| TryParseTryParseTryParse |
Converts a lexical representation of an xs:duration to its DurationDurationDuration
equivalent. A return value indicates whether the conversion succeeded or failed.
|
Operators
| Operator | Description | |
|---|---|---|
| AdditionAdditionAddition | Adds two specified DurationDurationDuration values. | |
| DivisionDivisionDivision | Divides the specified DurationDurationDuration value by a doubleDoubledouble value. | |
| EqualityEqualityEquality | Indicates whether a specified DurationDurationDuration is equal to another specified DurationDurationDuration. | |
| InequalityInequalityInequality | Indicates whether a specified DurationDurationDuration is not equal to another specified DurationDurationDuration. | |
| Multiply (double, Duration)Multiply (Double, Duration)Multiply (double, Duration) | Multiplies the specified DurationDurationDuration value by a doubleDoubledouble value. | |
| Multiply (Duration, double)Multiply (Duration, Double)Multiply (Duration, double) | Multiplies the specified DurationDurationDuration value by a doubleDoubledouble value. | |
| SubtractionSubtractionSubtraction | Subtracts a DurationDurationDuration value from another DurationDurationDuration value. | |
| UnaryNegationUnaryNegationUnaryNegation | Negates the value of the specified DurationDurationDuration operand. | |
| UnaryPlusUnaryPlusUnaryPlus | Returns the value of the DurationDurationDuration operand (the sign of the operand is unchanged). |
Fields
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.
