XQuery Function Documentation
http://exist-db.org/xquery/datetime
java:org.exist.xquery.modules.datetime.DateTimeModule
A module for performing date and time operations
datetime:count-day-in-month
Returns the count of a specific weekday in a month from the given date. For example it can tell you there are 5 Fridays in February 2008.
- Parameters:
-
$weekday The day of the week in the range of 1 to 7 where 1 = Sunday and 7 = Saturday. $date The day that will identify the month to get the count of the number of occurrences of a given weekday - Returns:
- xs:integer : The number of occurrences of the weekday in the selected month.
datetime:date-for
Returns the date for a given set of parameters.
- Parameters:
-
$year The year of interest $month The month of interest (1 = January, 12 = December) $week The week in the month of interest (1 = first week, 4 or 5 = last week) $weekday The day in the week of interest (1 = Sunday, 7 = Saturday) - Returns:
- xs:date : the date generated from the parameters.
datetime:date-from-dateTime
Returns the xs:date portion of an xs:dateTime
- Parameters:
-
$date-time The dateTime to extract the date from. - Returns:
- xs:date : the extracted date.
datetime:date-range
Generates a range of xs:date values, incremented cumulatively by a fixed duration from a start xs:date
- Parameters:
-
$start-date The date to start at. $increment The duration increment. $iterations The number of increments to generate. - Returns:
- xs:date* : the range(s)
datetime:datetime-range
Generates a range of xs:dateTime values, incremented cumulatively by a fixed duration from a start xs:dateTime
- Parameters:
-
$start-date-time The dateTime to start at. $increment The duration increment. $iterations The number of increments to generate. - Returns:
- xs:dateTime* : the range(s)
datetime:day-in-week
Returns the day in the week of the date. Result is in the range 1 to 7, where 1 = Sunday, 7 = Saturday.
- Parameters:
-
$date The date to extract the day in the week from. - Returns:
- xs:integer : the day in the week of the date in the range 1 to 7, where 1 = Sunday, 7 = Saturday.
datetime:days-in-month
Returns the number of days in the month of the date.
- Parameters:
-
$date The date for extracting the number of days in the month component. - Returns:
- xs:integer : the number of days in the given month.
datetime:format-date
Returns a xs:string of the xs:date formatted according to the SimpleDateFormat format.
- Parameters:
-
$date The date to to be formatted. $simple-date-format The format string according to the Java java.text.SimpleDateFormat class - Returns:
- xs:string : the formatted date string
datetime:format-dateTime
Returns a xs:string of the xs:dateTime according to the SimpleDateFormat format.
- Parameters:
-
$date-time The dateTime to to be formatted. $simple-date-format The format string according to the Java java.text.SimpleDateFormat class - Returns:
- xs:string : the formatted dateTime string
datetime:format-time
Returns a xs:string of the xs:time formatted according to the SimpleDateFormat format.
- Parameters:
-
$time The time to to be formatted. $simple-date-format The format string according to the Java java.text.SimpleDateFormat class - Returns:
- xs:string : the formatted time string
datetime:parse-date
Returns an xs:date of the xs:string parsed according to the SimpleDateFormat format.
- Parameters:
-
$date-string The date to to be parsed. $simple-date-format The format string according to the Java java.text.SimpleDateFormat class - Returns:
- xs:date : the parsed xs:date
datetime:parse-dateTime
Returns an xs:dateTime of the xs:string parsed according to the SimpleDateFormat format.
- Parameters:
-
$dateTime-string The date and time to to be parsed. $simple-date-format The format string according to the Java java.text.SimpleDateFormat class - Returns:
- xs:dateTime : the parsed xs:dateTime
datetime:parse-time
Returns an xs:time of the xs:string parsed according to the SimpleDateFormat format.
- Parameters:
-
$time-string The time to to be parsed. $simple-date-format The format string according to the Java java.text.SimpleDateFormat class - Returns:
- xs:time : the parsed xs:time
datetime:time-from-dateTime
Returns the xs:time portion of an xs:dateTime.
- Parameters:
-
$date-time The dateTime to extract the time from. - Returns:
- xs:time : the time extracted from the date-time
datetime:time-range
Generates a range of xs:time values, incremented cumulatively by a fixed duration from a start xs:time
- Parameters:
-
$start-time The time to start at. $increment The duration increment. $iterations The number of increments to generate. - Returns:
- xs:time* : the range(s)
datetime:timestamp
The current time as UTC milliseconds since the Epoch.
- Returns:
- xs:unsignedLong : milliseconds
datetime:timestamp
Return the number of UTC milliseconds since the Epoch for given date-time value.
- Parameters:
-
$date-time The dateTime to be converted. - Returns:
- xs:unsignedLong : milliseconds
datetime:timestamp-to-datetime
Return the date-time from value of number of UTC milliseconds since the Epoch.
- Parameters:
-
$ms The number of UTC milliseconds since the Epoch. - Returns:
- xs:date : the xs:dateTime
datetime:week-in-month
Returns the week in the month of the date.
- Parameters:
-
$date The date to extract the week in the month from. - Returns:
- xs:integer : the week in the month of the date