xf:get-minutes-from-dayTimeDuration

Extracts the number of minutes from the minutes component of $dayTimeDuration-var.

If the value of $dayTimeDuration-var is the empty sequence, the empty sequence is returned. The empty sequence is a sequence containing zero items (), which is similar to null in SQL.

Signatures

xf:get-minutes-from-dayTimeDuration(xf:dayTimeDuration? $dayTimeDuration-var) —> xs:integer?

Arguments

Data Type
Argument
Description

xf:dayTimeDuration

$dayTimeDuration-var

Contains a representation of a time duration which can contain days, hours, minutes, and seconds.

Returns

Returns the number as minutes as an integer from minutes component of $dayTimeDuration-var.

Examples

Get Minutes from dayTimeDuration with All Components

<minutes>{xf:get-minutes-from-dayTimeDuration(xf:dayTimeDuration("P7DT9H12M65S"))}</minutes> 

The preceding query generates the following result:

<minutes>12</minutes> 

Note: Even though 65 seconds is specified in the seconds component (65S) of the dayTimeDuration creation string (adding up to an additional minute), only 12 minutes are returned as originally specified by the minutes component (12M).

Get Minutes from dayTimeDuration with Just Negative Minutes

<minutes>{xf:get-minutes-from-dayTimeDuration(xf:dayTimeDuration("-PT3M"))}</minutes> 

The preceding query generates the following result:

<minutes>-3</minutes> 

Get Minutes from dayTimeDuration with No Minutes

<minutes>{xf:get-minutes-from-dayTimeDuration(xf:dayTimeDuration("P2DT20S"))}</minutes> 

The preceding query generates the following result:

<minutes>0</minutes> 

Related Topics

W3C get-minutes-from-dayTimeDuration function description.

W3C dayTimeDuration data type description.