Loading TOC...


fn.currentTime() as String


Returns xs:time(fn:current-dateTime()). This is an xs:time (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-time() is executed. This function is *stable*. The precise instant during the query or transformation represented by the value of fn:current-time() is *implementation dependent*.

Usage Notes

fn:current-time() returns an xs:time corresponding to the current date and time. For example, an invocation of fn:current-time() might return 23:17:00.000-05:00.



=> 14:15:55-07:00

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.


The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • How can I record the running time for some function call ? var start = xdmp.wallclockToTimestamp(fn.currentDateTime()) .... var end = xdmp.wallclockToTimestamp(fn.currentDateTime()) end-start always eq 0
    • See <a href="http://docs.marklogic.com/xdmp:elapsed-time">xdmp:elapsed-time</a>