month-from-date function
The fn:month-from-date function returns the month component of a xs:date value.
Syntax
- date-value
- The date value from which the month component is to be extracted.
date-value is of type xs:date, or is an empty sequence.
Returned value
If date-value is of type xs:date, the returned value is of type xs:integer, and the value is between 1 and 12, inclusive. The value is the month component of date-value.
If date-value is an empty sequence, the returned value is an empty sequence.
Example
The following function returns the month component of the date value for December 1, 2005.
fn:month-from-date(xs:date("2005-12-01"))
The returned value is 12.