PhoenixmlDb.Core
YearMonthDuration
Represents an xs:yearMonthDuration value as a count of months, implementing correct XML Schema semantics for month-based date arithmetic.
#YearMonthDuration
Namespace: PhoenixmlDb.Xdm
Represents an xs:yearMonthDuration value as a count of months, implementing correct XML Schema semantics for month-based date arithmetic.
Unlike , which only supports fixed-length durations, this type correctly handles variable-length months. For example, adding 1 month to January 31 yields February 28/29, which cannot be expressed as a fixed number of days. The canonical lexical form is PnYnM (e.g., P1Y6M for 18 months). Negative durations are prefixed with - (e.g., -P3M).
#Constructors
##ctor(Int32)
Represents an xs:yearMonthDuration value as a count of months, implementing correct XML Schema semantics for month-based date arithmetic.
Parameters:
-
TotalMonths— The total number of months (negative for negative durations).
Unlike , which only supports fixed-length durations, this type correctly handles variable-length months. For example, adding 1 month to January 31 yields February 28/29, which cannot be expressed as a fixed number of days. The canonical lexical form is PnYnM (e.g., P1Y6M for 18 months). Negative durations are prefixed with - (e.g., -P3M).
#Properties
| Name | Description |
|---|---|
TotalMonths
|
The total number of months (negative for negative durations). |