# op:add-dayTimeDuration-to-date

Adds $dayTimeDuration-var to the date specified by $date-var.

### Signatures

op:add-dayTimeDuration-to-date(xs:date $date-var, xf:dayTimeDuration $dayTimeDuration-var) —> xs:date

### Arguments

Data Type | Argument | Description
--- | --- | ---
xs:date | $date-var | Contains a representation of the date.
xf:dayTimeDuration | $dayTimeDuration-var | Contains a time duration that can contain days, hours, minutes, and seconds.

### Returns

Returns the date result of adding the date and time specified by $dayTimeDuration-var to date specified by $date-var. The returned date value has the same timezone as $date-var. If $date-var has no timezone, then the returned date value has the no timezone.

### Examples

#### Simple

The following example query adds a dayTimeDuration value equal to 1 day, 2 hours, 30 minutes, and 5 seconds to a date value equal to the date: January 1, 2003 as shown in the following query:

    <date>{
    	op:add-dayTimeDuration-to-date(xs:date("2003-01-01"), xf:dayTimeDuration("P1DT2H30M5S"))
    }</date>

The resulting date value equal to the date: January 2, 2003 is returned as shown in the following result:

    <date>2003-01-02</date>

Related Topics

W3C add-dayTimeDuration-to-date operator description.

W3C dayTimeDuration description.

xf:dayTimeDuration constructor description.

W3C date data type description

xs:date constructor description.