Extracts the year from $dateTime-var.
If the value of $dateTime-var is the empty sequence, the empty sequence is returned. The empty sequence is a sequence containing zero items (), which is similar to null in SQL.
xf:get-year-from-dateTime(xs:dateTime? $dateTime-var) —> xs:integer?
Returns the year as an integer from $dateTime-var.
When you invoke the following query:
<year>{xf:get-year-from-dateTime("2002-08-30T22:21:01")}</year>
The preceding query generates the following result:
<year>2002</year>
W3C get-year-from-dateTime function description.
W3C dateTime data type description.