Question

I'm trying to display the date for a year from now in an xslt file using umbraco like so:

<xsl:variable name="now" select="umbraco.library:CurrentDate()"/>
<xsl:value-of select="umbraco.library:DateAdd($now, 'year', 1)"/>

The value-of tag outputs today's date. How can I get the DateAdd to add a year to the current date?

Was it helpful?

Solution

The constant 'year' is wrong. It expects just 'y'.

<xsl:variable name="now" select="umbraco.library:CurrentDate()"/>
<xsl:value-of select="umbraco.library:DateAdd($now, 'y', 1)"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top