Re: current timestamp in XSLT 1.0
Hermann Stamm-Wilbrandt <[email protected]> Thu, 26 Apr 2012 22:47:17 +0200
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <OF66940F94.82210AA9-ONC12579EC.0071A393-C12579EC.007233DB@de.ibm.com> |
Hi,
date:time() without arguments gives you the current date+time.
date:seconds() gives you Epoch (or Unix) time, seconds since midnight 1st
January 1970 zulu time.
You can find xpath++ tool in this posting:
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14511881#14511881
It uses xsltproc by default, see this output wrt above statements:
$ echo "<foobar/>" | xpath++ "date:time()" -
22:20:48+02:00
$ echo "<foobar/>" | xpath++ "date:seconds()" -
1335471654
$
On DataPower XSLT processor you can get Unix time even at millisecond
resolution, see this posting:
https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/entry/now37
Mit besten Gruessen / Best wishes,
Hermann Stamm-Wilbrandt
Level 3 support for XML Compiler team and Fixpack team lead
WebSphere DataPower SOA Appliances
https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/
https://twitter.com/#!/HermannSW/
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
From: helix84 <[email protected]>
To: [email protected],
Date: 04/25/2012 10:37 AM
Subject: [exslt] current timestamp in XSLT 1.0
Sent by: [email protected]
Hello everyone,
I'm looking at http://www.exslt.org/date/index.html but I don't see a
function that returns current date and time as a unix timestamp. Am I
overlooking something? Or is there an easier way how to get current
timestamp in XSLT 1.0?
Regards,
~~helix84
_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list