If you are using an XSLT 1.0 processor which supports the EXSLT date functions (I've just tested this with libxslt in PHP), you can use date:add()
and date:duration()
:
<xsl:value-of select="date:add('1970-01-01T00:00:00Z', date:duration(@stamp div 1000))"/>
The date:duration()
function takes a number of seconds (so you have to divide your milliseconds by 1000) and turns it into a "duration" (in this case, "P14315DT20H12M26.6889998912811S
"), which is then added to the start of your epoch (looks like the standard epoch, for this stamp) with date:add()
to get a stamp of "2009-03-12T20:12:26.6889998912811Z
". You can then format this using the EXSLT date functions or just substring()
, depending on what you need.