XQuery/日期和時間
外觀
< XQuery
你需要一個用於日期和時間的示例函式的快速參考頁面。
我們將提供一個 XQuery 表示式及其結果的示例列表。
此函式返回在執行 XQuery 的系統上的當前日期,採用 W3C XML 模式日期格式
current-date()
結果
2010-05-28-05:00
請注意,“-05:00” 是伺服器相對於 GMT 的偏移量。
current-time()
結果
07:02:11.616-05:00
current-dateTime()
結果
2010-05-28T06:59:05.526-05:00
請注意,預設情況下,字母“T”分隔日期和時間。小數點後的結果是毫秒數。
xs:date(current-dateTime()) - xs:dayTimeDuration('P7D')
結果
2010-05-21-05:00