MarkLogic 9 Product Documentation
functions (DurationDateTime)
The duration, date, and time built-in functions are XQuery functions
that operate on duration-, date-, and time-related values.
They are defined in
XQuery 1.0
and XPath 2.0 Functions and Operators .
9 functions
Function name
Description
sql:dateadd
Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date
sql:datediff
Returns the count (signed integer) of the specified datepart boundaries crossed between the specified startdate and enddate.
sql:datepart
Returns an integer that represents the specified datepart of the specified date.
xdmp:dayname-from-date
Returns a string representing the dayname value in the localized value of $arg.
xdmp:month-name-from-date
Returns month name, calculated from the localized value of $arg.
xdmp:quarter-from-date
Returns an integer between 1 and 4, both inclusive, calculating the quarter component in the localized value of $arg.
xdmp:week-from-date
Returns an integer between 1 and 53, both inclusive, representing the week value in the localized value of $arg.
xdmp:weekday-from-date
Returns an integer in the range 1 to 7, inclusive, representing the weekday value in the localized value of $arg.
xdmp:yearday-from-date
Returns an integer between 1 and 366, both inclusive, representing the yearday value in the localized value of $arg.