XSLT and XPath function reference in alphabetical order

(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 5, translated from German)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z



Context information – date and time


XPath 2.0

Return value:

The date value with daytime portion in the xs:dateTime format being current for the evaluation context.



No arguments.

Purpose of use:

The fn:current-dateTime() function is called up without passing on an argument. The timestamp value returned by the function is dependent on the valid context at the time of the evaluation of the appropriate XPath expression.

During a XSLT transformation, the function usually returns a timestamp value calculated from the system date and the system time. The value may contain the implicit timezone as a timezone indication.

The function is stable and therefore returns during an ongoing transformation a constant value.

Example 1 - timestamp value with timezone in the function context:

fn:current-dateTime() returns: 2007-07-10T20:48:10.553+12:00.

The function returns the current timestamp value in a context-dependent way – here with a timezone indication.

Example 2 - timestamp value without timezone in the function context:

fn:current-dateTime() returns: 2007-07-10T20:48:10.553Z.

If there is no implicit timezone, the mere timestamp value is returned – in this case with a postpositioned Z.

Function definition:

XPath 1.0:

The function is not available.

XPath 2.0:

fn:current-dateTime() as xs:dateTime


<< back next >>




Copyright © Galileo Press, Bonn 2008
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSLT 2.0 & XPath 2.0" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

Galileo Press, Rheinwerkallee 4, 53227 Bonn, Germany