fn:current-dateTime

Returns the current date and time (with timezone).

Signature

fn:current-dateTime() as xs:dateTimeStamp

Properties

This function is deterministic, context-dependent, and focus-independent. It depends on implicit timezone.

Rules

Returns the current dateTime (with timezone) from the dynamic context. (See Dynamic Context Components.) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime is executed.

This function is deterministic. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is implementation-dependent.

If the implementation supports data types from XSD 1.1 then the returned value will be an instance of xs:dateTimeStamp. Otherwise, the only guarantees are that it will be an instance of xs:dateTime and will have a timezone component.

Notes

The returned xs:dateTime will always have an associated timezone, which will always be the same as the implicit timezone in the dynamic context

Examples

fn:current-dateTime() returns an xs:dateTimeStamp corresponding to the current date and time. For example, a call of fn:current-dateTime() might return 2004-05-12T18:17:15.125Z corresponding to the current time on May 12, 2004 in timezone Z.