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 daytime in the xs:time format being current for the evaluation context.



No arguments.

Purpose of use:

The fn:current-time() function is called up without passing on an argument. The time 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 the daytime calculated from the system time. The value may contain the implicit timezone as a timezone indication.

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

Example 1 - timestamp value with timezone:

fn:current-time() returns: 20:48:10.553+12:00.

Dependent on the context, the function returns the current time value - here with a timezone indication.

Example 2 - date without timezone:

fn:current-time() returns: 20:48:10.553Z.

If no implicit timezone is indicated, the mere time 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-time() as xs:time


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