# EXSLT - date:add-duration

Implementer Page: date.add-duration.html Function Package: date.add-duration.zip #### Function Syntax
    string date:add-duration(string, string)
#### Template Syntax
    <xsl:call-template name="date:add-duration">
       <xsl:with-param name="duration1" select="string" />
       <xsl:with-param name="duration2" select="string" />
    </xsl:call-template>
The `date:add-duration` function returns the duration resulting from adding two durations together. Both arguments are strings in the format defined for `xs:duration` in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. If either argument is not in this format, the function returns an empty string (`''`). The return value is a string in the format defined for `xs:duration` in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The durations can usually be added by summing the numbers given for each of the components in the durations. However, if the durations are differently signed, then this sometimes results in durations that are impossible to express in this syntax (e.g. `'P1M'` + `'-P1D'`). In these cases, the function returns an empty string (`''`). ## Implementations The following XSLT processors support `date:add-duration`: libxslt from Daniel Veillard et al. (version 1.0.19) Implementations of `date:add-duration` are available in the following languages: EXSLT Function (by Jeni Tennison) XSLT Template (by Jeni Tennison) Javascript (by Chris Bayes) Msxsl (by Chris Bayes)

http://www.exslt.org/date/functions/add-duration/index.html last modified 2002-08-21