I included below as function in my ml-datetime library:

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

Which you can install with mlpm install ml-datetime
(http://registry.demo.marklogic.com/package/ml-datetime/)


You also have http://docs.marklogic.com/xdmp:timestamp-to-wallclock,
though that might be more centered around ML timestamps, not Unix
timestamps..

Cheers

On 9/23/16, 9:26 AM, "general-boun...@developer.marklogic.com on behalf of
Florent Georges" <general-boun...@developer.marklogic.com on behalf of
li...@fgeorges.org> wrote:

>Hi,
>
>You should be able to use the following expression, given $seconds is
>your timestamp, to get a date-time.  I am not sure about the limits on
>the number of seconds you can have in a duration, though:
>
>xs:dateTime('1970-01-01T00:00:00+00:00')
>   + xs:duration('PT' || $seconds || 'S')
>
>Regards,
>
>-- 
>Florent Georges
>http://fgeorges.org/
>http://h2oconsulting.be/
>
>
>On 23 September 2016 at 09:14, Debin, Infant Jerald (LNG-CON) wrote:
>> Hi,
>>
>>
>>
>> Is there a way to convert the unix timestamp to HH/MM/SS format in
>>marklogic
>> using xquery.
>>
>>
>>
>> Unit timestamp that is in xml is in below ,
>>
>>
>>
>> <timestamp>1472812470453</timestamp>
>>
>>
>>
>> Thanks,
>>
>> Debin
>>
>>
>> _______________________________________________
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>_______________________________________________
>General mailing list
>General@developer.marklogic.com
>Manage your subscription at:
>http://developer.marklogic.com/mailman/listinfo/general

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

Reply via email to