Re: [MarkLogic Dev General] Date Time value not correct while using DLS API

2017-07-27 Thread Geert Josten
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: 
mailto:general-boun...@developer.marklogic.com>>
 on behalf of amit gope mailto:amitgo...@gmail.com>>
Reply-To: MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Thursday, July 27, 2017 at 10:49 AM
To: "general@developer.marklogic.com<mailto: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:
http://marklogic.com/xdmp/dls";>
http://www.google.com/metadata/core/00-2754195023.xml
auser
0
1501144206
http://marklogic.com/xdmp/security";>7071164303237443533


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


[MarkLogic Dev General] Date Time value not correct while using DLS API

2017-07-27 Thread amit gope
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:
http://marklogic.com/xdmp/dls";>
http://www.google.com/metadata/core/00-2754195023.xml

auser
0
1501144206
http://marklogic.com/xdmp/security
">7071164303237443533


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