tags:

views:

125

answers:

2
+1  Q: 

Increment the date

I am not sure if it is something with xslt or xpath..but how do I increment a date by 1 day? For example, if the date is 2/16/2009 I want the date to become 2/17/2009.

A: 

if date is 02/16/2009 i want it to be incremented to 02/17/2009

Hi Ash, It is recommended that you delete this answer and put further updates into your question by selecting "edit" underneath your question text. Good luck with Stack Overflow.
Alex B
I do not see a delete option..i am sorry..
+1  A: 

http://www.dpawson.co.uk/xsl/rev2/dates.html contains the snippet

<xsl:function name="dp:date-add">
    <xsl:param name="date" as="xs:dateTime"/>
    <xsl:param name="days" as="xs:integer"/>
    <xsl:variable name="day" select="$date + ($one-day * $days)"/>
    <xsl:value-of select="format-dateTime($day,'[Y,*-2]-[M,2]-[D,2]')"/>
</xsl:function>

I have not tested this, but it claims to add the values of "days" to "date". I recall doing something similar, but my XSLT code was replaced long ago with template pages.

Godeke