Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

XQuery/Dates and Time

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Motivation You want a quick reference page of sample functions that work with dates and times. Method We will provide a sample list of XQuery expressions and their results. Current Date This function returns the current date on the system that is executing the XQuery in W3C XML Schema date format: current-date() Result: 2010-05-28-05:00 Note that the "-05:00" is the offset from GMT of the server. Current Time current-time() Result: 07:02:11.616-05:00 Current Date and Time current-dateTime() Result 2010-05-28T06:59:05.526-05:00 Note that default the letter 'T" separates the date and the time. The results after the decimal point are the number of milliseconds. One Week Ago xs:date(current-dateTime()) - xs:dayTimeDuration('P7D') Result: 2010-05-21-05:00