Having seen Date operations on xsl 1.0
<xsl:template name="JDN">
<xsl:param name="date"/>
<xsl:param name="year" select="substring($date, 1, 4)"/>
<xsl:param name="month" select="substring($date, 6, 2)"/>
<xsl:param name="day" select="substring($date, 9, 2)"/>
<xsl:param name="a" select="floor((14 - $month) div 12)"/>
<xsl:param name="y" select="$year + 4800 - $a"/>
<xsl:param name="m" select="$month + 12*$a - 3"/>
<xsl:value-of select="$day + floor((153*$m + 2) div 5) + 365*$y + floor($y div 4) - floor($y div 100) + floor($y div 400) - 32045" />
I'd like to have a reference back to something a bit more concrete, rather than a stack overflow answer...it seems to work!....and I believe its based on some standard mathematical model for datetimes...is there some sort of canonical XSLT 1.0 implementation? published in a book or a library? i.e. how do I know there isn't a typo? I think implementing the model in XSLT is non trivial, I don't want to have to reinvent the wheel.