XQuery - current-dateTime 函式



current-dateTime 函式用於返回當前日期和時間。

語法

current-dateTime()

示例

XQuery 表示式

let $datetime := current-dateTime()

return
<results>
   <datetime>{$datetime}</datetime>
</results>

輸出

<results>
   <datetime>2014-10-27T14:55:58.621+05:30</datetime>result
</results>

這裡 T 用作日期和時間的分隔符,+5:30 表示伺服器的相對 GMT 時間。

驗證結果

要測試上述功能,請用上述 XQuery 表示式替換 環境設定 章節中提到的 books.xqy(位於)中的內容,並執行 XQueryTester java 程式以驗證結果。

列印
xquery_date_functions.htm
廣告