I have needed to do Date manipulation in XSLT for my SharePoint projects. On searching around, I found this site:
They have a number of "modules", including a whole bunch on Dates and Times, and have several different implementations of each function, including XSL Templates that work with XSLT v1.0 (why is SharePoint still in the XSL dark ages!?)
I did find that I needed to tweak them a little to work within a DVWP, though I might be doing something wrong... here's what I needed to do.
1. The "how to" page on the website explains how to add the namespace (e.g. all the date templates are prefixed with "date:"), but I couldn't get that to work, so I effectively removed the namespace by removing the ":"
2. I needed to modify the <xsl:stylesheet version="1.0" extension-element-prefixes="date"> at the top of the templates to be the same <xsl:stylesheet> as used in the main DVWP
3. Occasionally there are XML fragments in the templates (e.g. for Month lengths), which are referenced like this:
<xsl:variable name="month-days" select="document('')/*/date:month-lengths/date:month"/>
I changed these to have an XSL Variable surrounding the fragments and changed the accessing code to be as follows:
<xsl:variable name="month-days" select="msxsl:node-set($datemonth)/datemonth-lengths/datemonth"/>
4. I also found on one occasion that a newline in the template (inside the "test" of an <xsl:if statement>) gave an error, but simply removing the line breaks solved this problem.
I have been very happy with the results of using these templates, so hope others find them helpful. If you would like me to post the slightly-modified versions, I'd be happy to.