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

fn:minutes-from-dateTime

Category:

Value extraction from time values, date values and duration

Origin:

XPath 2.0

Return value:

An integer of xs:integer type which corresponds to the value of the minutes component of the normalised xs:dateTime timestamp value passed on.

Call/Arguments:

fn:minutes-from-dateTime($timestamp)

$timestamp:

Optional. A timestamp value of xs:dateTime type which may include a timezone indication. If no value is passed on, which means the empty sequence, the function returns the empty sequence.

Purpose of use:

The function returns a xs:integer integer between (inclusive) 0 and 59 which corresponds to the minutes component of the normalised value.

A normalisation of the timestamp value, which means the inclusion of the duration of the timezone difference, usually has no influence on the minutes component since timezone indications include entire hours (there is a hypothetical exception in example 2).

Example 1 - minutes from timestamp value, version 1:

fn:minutes-from-dateTime(

xs:dateTime("2007-05-31T13:20:00-05:00")

)

Results in: 20.

The minutes component is directly extracted. The normalisation has no influence since the timezone difference only affects the hours value.

Example 2 - minutes from timestamp value, version 2:

fn:minutes-from-dateTime(

xs:dateTime("1999-05-31T13:30:00+05:30")

)

Results in: 0.

In this example a fictive timezone correction factor of +5 1/2 hours is assumed whose subtraction makes the minutes component to 0.

Function definition:

XPath 1.0:

The function is not available.

XPath 2.0:

fn:minutes-from-dateTime($arg as xs:dateTime?) as xs:integer?

   

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