Usage of current-dateTime () function in an XSLT doc transfo

Questions about XML that are not covered by the other forums should go here.
JamesWebster
Posts: 1
Joined: Wed Jul 30, 2014 4:39 pm

Usage of current-dateTime () function in an XSLT doc transfo

Post by JamesWebster »

All,

I apologize for this obviously silly question but here goes...How does one call and display the current date and time in an XSLT transformation document? It is not existing in the XML document and I cannot find any XSLT samples where it is used online anywhere. Any namespace requirement(s) and samples would be wonderful.

Thank you in Advance!

James
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Usage of current-dateTime () function in an XSLT doc tra

Post by adrian »

Hi,

You can simply evaluate it with xsl:value-of.

Code: Select all

<xsl:value-of select="current-dateTime()"/>
Note that this is an XPath 2.0 function, so it only works in XSLT 2.0 and later.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply