xml
  1. xml-current-time

XML current-time()

  • The current-time() function in XQuery returns the current time as an xs:time value.
  • It does not take any arguments.

Syntax

The syntax of the current-time() function is as follows:

current-time()

Example

Consider the following XQuery example:

xquery version "3.1";

let $time := current-time()
return $time

Output:

12:34:56.789Z

Explanation

In the above example, we are using the current-time() function to retrieve the current time in the xs:time format. We are then assigning this value to the variable $time and returning it. The output shows the current time in the format of hh:mm:ss.sssZ.

Use

The current-time() function can be used to extract the current time in XQuery. It is often used in conjunction with other date and time functions to perform complex operations on dates and times.

Important Points

  • The current-time() function returns the current time as an xs:time value.
  • It does not take any arguments.
  • The format of the returned time is hh:mm:ss.sssZ.

Summary

In summary, the current-time() function in XQuery returns the current time as an xs:time value. It is often used in conjunction with other date and time functions to perform complex operations on dates and times. The returned time format is hh:mm:ss.sssZ.

Published on: