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

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

Wed Jul 30, 2014 4:45 pm

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: 2443

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

Wed Jul 30, 2014 5:05 pm

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

Return to “General XML Questions”

Who is online

Users browsing this forum: No registered users and 0 guests