Date & Time Functions
Date & Time Functions
current-date
current-date() as xs:date
Returns the current date.
current-dateTime
current-dateTime() as xs:dateTime
Returns the current date and time.
current-time
current-time() as xs:time
Returns the current time.
format-date
format-date($value as xs:date, $picture as xs:string) as xs:string
Formats a date according to the picture string.
Component Extraction
These functions extract individual components from date, time, dateTime, and duration values:
| Function | Argument | Returns |
|---|---|---|
year-from-date |
xs:date |
xs:integer |
month-from-date |
xs:date |
xs:integer |
day-from-date |
xs:date |
xs:integer |
year-from-dateTime |
xs:dateTime |
xs:integer |
month-from-dateTime |
xs:dateTime |
xs:integer |
day-from-dateTime |
xs:dateTime |
xs:integer |
hours-from-dateTime |
xs:dateTime |
xs:integer |
minutes-from-dateTime |
xs:dateTime |
xs:integer |
seconds-from-dateTime |
xs:dateTime |
xs:decimal |
hours-from-time |
xs:time |
xs:integer |
minutes-from-time |
xs:time |
xs:integer |
seconds-from-time |
xs:time |
xs:decimal |
years-from-duration |
xs:duration |
xs:integer |
months-from-duration |
xs:duration |
xs:integer |
days-from-duration |
xs:duration |
xs:integer |
hours-from-duration |
xs:duration |
xs:integer |
minutes-from-duration |
xs:duration |
xs:integer |
seconds-from-duration |
xs:duration |
xs:decimal |
Timezone Adjustment
| Function | Argument | Returns |
|---|---|---|
adjust-date-to-timezone |
xs:date, xs:dayTimeDuration? |
xs:date? |
adjust-dateTime-to-timezone |
xs:dateTime, xs:dayTimeDuration? |
xs:dateTime? |
adjust-time-to-timezone |
xs:time, xs:dayTimeDuration? |
xs:time? |
timezone-from-date |
xs:date |
xs:dayTimeDuration? |
timezone-from-dateTime |
xs:dateTime |
xs:dayTimeDuration? |
timezone-from-time |
xs:time |
xs:dayTimeDuration? |