I have an Input XML in which I have an time-stamp in long digit. I am trying to convert it into readable date format. I searched on internet and found few solutions. But none of them is working. Please guide me , what am I missing?.
I want to convert this long time-stamp (milliseconds to readable date format).
Input XML:
<Order>
<value>1467702989532</value>
</Order>
XSLT:
<?xml version="1.0"?>
<xsl:stylesheet xmlns="http://www.w3.org/TR/xhtml1/strict" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
<xsl:output method ="xml" indent="yes"/>
<xsl:template match="/Order">
<NewOrder>
<dateValue>
<xsl:value-of select='xs:dateTime("1970-01-01T00:00:00") + value * xs:dayTimeDuration("PT0.001S")'/>
</dateValue>
</NewOrder>
</xsl:template>
</xsl:stylesheet>
Current Output:
<?xml version="1.0" encoding="UTF-8"?>
<NewOrder xmlns="http://www.w3.org/TR/xhtml1/strict" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<dateValue />
</NewOrder>