[英]Using DateAdd in umbraco xslt to display next year's date
I'm trying to display the date for a year from now in an xslt file using umbraco like so: 我正在尝试使用umbraco在xslt文件中显示从现在开始一年的日期,如下所示:
<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. value-of标签输出今天的日期。 How can I get the DateAdd to add a year to the current date?
如何获取DateAdd来向当前日期添加年份?
The constant 'year' is wrong. 不变的“年份”是错误的。 It expects just 'y'.
它期望只是“ y”。
<xsl:variable name="now" select="umbraco.library:CurrentDate()"/>
<xsl:value-of select="umbraco.library:DateAdd($now, 'y', 1)"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.