# xf:get-month-from-date

Extracts the month from $date-var.

If the value of $date-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.

### Signatures

xf:get-month-from-date(xs:date? $date-var) —> xs:integer?

### Arguments

Data Type | Argument | Description
--- | --- | ---
xs:date? | $date-var | Contains a representation of the date.

### Returns

Returns the month as an integer from $date-var.

### Examples

#### Simple

When you invoke the following query:

    <month>{get-month-from-date("2002-08-30")}</month>

The preceding query generates the following result:

    <month>8</month>

Related Topics

W3C get-month-from-date function description.

W3C date data type description.