# EXSLT - date:add

Implementer Page: date.add.html Function Package: date.add.zip #### Function Syntax
    string date:add(string, string)
#### Template Syntax
    <xsl:call-template name="date:add">
       <xsl:with-param name="date-time" select="string" />
       <xsl:with-param name="duration" select="string" />
    </xsl:call-template>
The `date:add` function returns the date/time resulting from adding a duration to a date/time. The first argument must be right-truncated date/time strings in one of the formats defined in [XML Schema Part 2: Datatypes]. The permitted formats are as follows: `xs:dateTime` (`CCYY-MM-DDThh:mm:ss`) `xs:date` (`CCYY-MM-DD`) `xs:gYearMonth` (`CCYY-MM`) `xs:gYear` (`CCYY`) The second argument is a string in the format defined for `xs:duration` in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The return value is a right-truncated date/time strings in one of the formats defined in [XML Schema Part 2: Datatypes] and listed above. This value is calculated using the algorithm described in [Appendix E Adding durations to dateTimes] of [XML Schema Part 2: Datatypes]. ## Implementations The following XSLT processors support `date:add`: 4XSLT, from 4Suite. (version 0.12.0a3) libxslt from Daniel Veillard et al. (version 1.0.19) Implementations of `date:add` 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/index.html last modified 2002-11-12