# xf:get-seconds-from-dayTimeDuration

Extracts the number of seconds from the seconds 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-seconds-from-dayTimeDuration(xf:dayTimeDuration? $dayTimeDuration-var) —> xs:decimal?

### 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 seconds as an decimal from seconds component of $dayTimeDuration-var.

### Examples

#### Get Seconds from dayTimeDuration with All Components

    <seconds>{xf:get-seconds-from-dayTimeDuration(xf:dayTimeDuration("P7DT9H12M14S"))}</seconds>

The preceding query generates the following result:

    <seconds>14</seconds>

#### Get Seconds from dayTimeDuration with Just Negative Seconds

    <seconds>{xf:get-seconds-from-dayTimeDuration(xf:dayTimeDuration("-PT7S"))}</seconds>

The preceding query generates the following result:

    <seconds>-7</seconds>

#### Get Seconds from dayTimeDuration with No Seconds

    <seconds>{xf:get-seconds-from-dayTimeDuration(xf:dayTimeDuration("P2DT6M"))}</seconds>

The preceding query generates the following result:

    <seconds>0</seconds>

Related Topics

W3C get-seconds-from-dayTimeDuration function description.

W3C dayTimeDuration data type description.