fn:month-from-dateTime

Return month integer value from datetime argument.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

fn:month-from-dateTime(xs:dateTime? $arg) => xs:integer?

Description

This function returns an integer value between 1 and 12, representing the month component of the localized value of the argument value. The localized value is the value in its original timezone or without timezone. If the argument is an empty sequence, the empty sequence is returned.

Argument

$arg

argument value of type xs:dateTime

Examples

  • This function call returns the month component of the current date and time:

    month-from-dateTime(current-dateTime())
  • This function call returns the month component of the specified date time value which is 5:

    month-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))