marklogic_coder
marklogic_coder

Reputation: 1510

Convert timestamp to dateTime in MarkLogic

I am using xdmp:document-timestamp function to get the timestamp of the most recent update that happened on this document.

Above function returns timestamp as output like: 16222984921692864.

How can I convert this timestamp 16222984921692864 to the human readable xs:dateTime?

Upvotes: 2

Views: 486

Answers (1)

marklogic_coder
marklogic_coder

Reputation: 1510

We can use the xdmp:timestamp-to-wallclock function to convert timestamp to dateTime.

xdmp:timestamp-to-wallclock(16222984921692864)

returns:

2021-05-29T10:28:12.1692864

Upvotes: 2

Related Questions