Hi Amit,

It is a so-called epoch timestamp, which is calculated as sec or millisec from 
1970-01-01. The documentation shows how to convert dateTime to lock timestamps:

http://docs.marklogic.com/xdmp:document-locks

And this function shows how you could go back:

https://github.com/grtjn/ml-datetime/blob/master/datetime.xqy#L515

Though the latter assumes epoch timestamps in millisec, whereas lock timestamps 
seem to be in sec..

Cheers,
Geert

From: 
<general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>>
 on behalf of amit gope <amitgo...@gmail.com<mailto:amitgo...@gmail.com>>
Reply-To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Date: Thursday, July 27, 2017 at 10:49 AM
To: "general@developer.marklogic.com<mailto:general@developer.marklogic.com>" 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: [MarkLogic Dev General] Date Time value not correct while using DLS API

Hi Team.

We are using DLS api for one of our projects making different versions of a 
given document, when the dls:checkout is happening, the entry that is being 
made for the timestamp value is:
<dls:checkout xmlns:dls="http://marklogic.com/xdmp/dls";>
<dls:document-uri>http://www.google.com/metadata/core/00-2754195023.xml</dls:document-uri>
<dls:annotation>auser</dls:annotation>
<dls:timeout>0</dls:timeout>
<dls:timestamp>1501144206</dls:timestamp>
<sec:user-id 
xmlns:sec="http://marklogic.com/xdmp/security";>7071164303237443533</sec:user-id>
</dls:checkout>

When we are using the 
format-dateTime/xdmp:timestamp-to-wallclock(xs:unsignedLong(1501144206)) on the 
dls:timestamp the date turns out to be 1970-01-01, whereas the checkout was 
done today, can you please suggest from where the timestamp is getting created 
and why it dates back to 1970?
--
Best Regards
Amit

_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to