XML technologies / XSLT / XSLT and XPath functions / Alphabetical XSLT and XPath reference / minutes-from-time

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

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 time value passed on.

Call/Arguments:

fn:minutes-from-time($timeIndication)

$timeIndication:

Optional. A daytime indication of xs:time type which may contain a timezone indication. If the input sequence is empty, the function returns the empty sequence.

Purpose of use:

The return value is an integer between (inclusive) 0 and 59 which corresponds to the minutes component of the time normalised value.

A normalisation of the time value by inclusion of a timezone difference usually has no influence on its minutes component since timezone indications do not cover entire hours.

Example 1 - minutes component from time:

fn:minutes-from-time(

xs:time("13:00:00Z")

)

Results in: 0.

The time is already in UTC time so that a normalisation is not required (which would have no effect here anyway). The minutes component can be extracted directly.

Example 2 - minutes component from time:

fn:minutes-from-time(

xs:time("21:35:00-5:00")

)

Results in: 35.

In this case there is an explicit timezone indication. However, the normalisation does not have an effect on the value of the minutes component.

Function definition:

XPath 1.0:

The function is not available.

XPath 2.0:

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

   

 

 

 

back to top