YearMonthDuration StructureYearMonthDuration StructureYearMonthDuration Structure
Represents a duration of time that is expressed by the Gregorian year and month components.
The corresponding XML Schema type is
xs:yearMonthDuration
.
Syntax
Public NotInheritable YearMonthDuration _ Implements IComparable(Of YearMonthDuration), _ IEquatable(Of YearMonthDuration)
public sealed YearMonthDuration : IComparable<YearMonthDuration>, IEquatable<YearMonthDuration>
public: value class YearMonthDuration sealed : IComparable<YearMonthDuration>, IEquatable<YearMonthDuration>
The YearMonthDurationYearMonthDurationYearMonthDuration
type exposes the following members.
Constructors
Constructor | Description | |
---|---|---|
YearMonthDuration (int, int)YearMonthDuration (Integer, Integer)YearMonthDuration (int, int) | Initializes a new instance of the YearMonthDurationYearMonthDurationYearMonthDuration structure with the specified duration in years and months. | |
YearMonthDuration (long)YearMonthDuration (Long)YearMonthDuration (long) | Initializes a new instance of the YearMonthDurationYearMonthDurationYearMonthDuration structure with the specified duration in months. |
Properties
Property | Description | |
---|---|---|
MonthsMonthsMonths | Gets the months component of the current YearMonthDurationYearMonthDurationYearMonthDuration. | |
TotalMonthsTotalMonthsTotalMonths | Gets the value of the current YearMonthDurationYearMonthDurationYearMonthDuration expressed as a number of months. | |
YearsYearsYears | Gets the years component of the current YearMonthDurationYearMonthDurationYearMonthDuration. |
Methods
Method | Description | |
---|---|---|
AddAddAdd | Adds two specified YearMonthDurationYearMonthDurationYearMonthDuration values. | |
CompareCompareCompare | Compares two specified YearMonthDurationYearMonthDurationYearMonthDuration values. | |
CompareToCompareToCompareTo | Compares this instance to a specified YearMonthDurationYearMonthDurationYearMonthDuration and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified YearMonthDurationYearMonthDurationYearMonthDuration. | |
Divide (YearMonthDuration, double)Divide (YearMonthDuration, Double)Divide (YearMonthDuration, double) | Divides the specified YearMonthDurationYearMonthDurationYearMonthDuration value by a doubleDoubledouble value. | |
Divide (YearMonthDuration, YearMonthDuration)Divide (YearMonthDuration, YearMonthDuration)Divide (YearMonthDuration, YearMonthDuration) | Divides the specified YearMonthDurationYearMonthDurationYearMonthDuration value by another YearMonthDurationYearMonthDurationYearMonthDuration value. | |
Equals (object)Equals (Object)Equals (object^) | Determines whether this instance is equal to a specified object. (Overrides ValueType.EqualsValueType.EqualsValueType::Equals) | |
Equals (YearMonthDuration)Equals (YearMonthDuration)Equals (YearMonthDuration) | Indicates whether this instance is equal to another YearMonthDurationYearMonthDurationYearMonthDuration. | |
Object.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) | |
GetHashCodeGetHashCodeGetHashCode | Returns the hash code for this instance. (Overrides ValueType.GetHashCodeValueType.GetHashCodeValueType::GetHashCode) | |
Object.GetTypeObject.GetTypeObject::GetType | Gets the TypeTypeType 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, YearMonthDuration)Multiply (Double, YearMonthDuration)Multiply (double, YearMonthDuration) | Multiplies the specified YearMonthDurationYearMonthDurationYearMonthDuration value by a doubleDoubledouble value. | |
Multiply (YearMonthDuration, double)Multiply (YearMonthDuration, Double)Multiply (YearMonthDuration, double) | Multiplies the specified YearMonthDurationYearMonthDurationYearMonthDuration value by a doubleDoubledouble value. | |
NegateNegateNegate | Negates the value of the specified YearMonthDurationYearMonthDurationYearMonthDuration operand. | |
ParseParseParse |
Converts a lexical representation of an xs:yearMonthDuration to its YearMonthDurationYearMonthDurationYearMonthDuration
equivalent.
| |
PlusPlusPlus | Returns the value of the YearMonthDurationYearMonthDurationYearMonthDuration operand (the sign of the operand is unchanged). | |
SubtractSubtractSubtract | Subtracts a YearMonthDurationYearMonthDurationYearMonthDuration value from another YearMonthDurationYearMonthDurationYearMonthDuration value. | |
ToStringToStringToString | Returns the canonical lexical representation of this YearMonthDurationYearMonthDurationYearMonthDuration. (Overrides ValueType.ToStringValueType.ToStringValueType::ToString) | |
TryParseTryParseTryParse |
Converts a lexical representation of an xs:yearMonthDuration to its YearMonthDurationYearMonthDurationYearMonthDuration
equivalent. A return value indicates whether the conversion succeeded or failed.
|
Operators
Operator | Description | |
---|---|---|
AdditionAdditionAddition | Adds two specified YearMonthDurationYearMonthDurationYearMonthDuration values. | |
Division (YearMonthDuration, double)Division (YearMonthDuration, Double)Division (YearMonthDuration, double) | Divides the specified YearMonthDurationYearMonthDurationYearMonthDuration value by a doubleDoubledouble value. | |
Division (YearMonthDuration, YearMonthDuration)Division (YearMonthDuration, YearMonthDuration)Division (YearMonthDuration, YearMonthDuration) | Divides the specified YearMonthDurationYearMonthDurationYearMonthDuration value by another YearMonthDurationYearMonthDurationYearMonthDuration value. | |
EqualityEqualityEquality | Indicates whether a specified YearMonthDurationYearMonthDurationYearMonthDuration is equal to another specified YearMonthDurationYearMonthDurationYearMonthDuration. | |
GreaterThanGreaterThanGreaterThan | Indicates whether a specified YearMonthDurationYearMonthDurationYearMonthDuration is greater than another specified YearMonthDurationYearMonthDurationYearMonthDuration. | |
GreaterThanOrEqualGreaterThanOrEqualGreaterThanOrEqual | Indicates whether a specified YearMonthDurationYearMonthDurationYearMonthDuration is greater than or equal to another specified YearMonthDurationYearMonthDurationYearMonthDuration. | |
InequalityInequalityInequality | Indicates whether a specified YearMonthDurationYearMonthDurationYearMonthDuration is not equal to another specified YearMonthDurationYearMonthDurationYearMonthDuration. | |
LessThanLessThanLessThan | Indicates whether a specified YearMonthDurationYearMonthDurationYearMonthDuration is less than another specified YearMonthDurationYearMonthDurationYearMonthDuration. | |
LessThanOrEqualLessThanOrEqualLessThanOrEqual | Indicates whether a specified YearMonthDurationYearMonthDurationYearMonthDuration is less than or equal to another specified YearMonthDurationYearMonthDurationYearMonthDuration. | |
Multiply (double, YearMonthDuration)Multiply (Double, YearMonthDuration)Multiply (double, YearMonthDuration) | Multiplies the specified YearMonthDurationYearMonthDurationYearMonthDuration value by a doubleDoubledouble value. | |
Multiply (YearMonthDuration, double)Multiply (YearMonthDuration, Double)Multiply (YearMonthDuration, double) | Multiplies the specified YearMonthDurationYearMonthDurationYearMonthDuration value by a doubleDoubledouble value. | |
SubtractionSubtractionSubtraction | Subtracts a YearMonthDurationYearMonthDurationYearMonthDuration value from another YearMonthDurationYearMonthDurationYearMonthDuration value. | |
UnaryNegationUnaryNegationUnaryNegation | Negates the value of the specified YearMonthDurationYearMonthDurationYearMonthDuration operand. | |
UnaryPlusUnaryPlusUnaryPlus | Returns the value of the YearMonthDurationYearMonthDurationYearMonthDuration operand (the sign of the operand is unchanged). |
Fields
Field | Description | |
---|---|---|
MaxValueMaxValueMaxValue | Represents the maximum YearMonthDurationYearMonthDurationYearMonthDuration representable value. This field is read-only. | |
MinValueMinValueMinValue | Represents the minimum representable YearMonthDurationYearMonthDurationYearMonthDuration value. This field is read-only. |
Remarks
A YearMonthDurationYearMonthDurationYearMonthDuration is a duration of time that is expressed by the Gregorian year and month. It can be used to represent a period of months, regardless of the number of days in a month. To say, for example, that a season lasts three months.
Unlike DurationDurationDuration values, YearMonthDurationYearMonthDurationYearMonthDuration values can be totally ordered.