2016-07-06 66 views
0

我想一年添加到XSL 2.0 当前的日期我知道如何获得当前日期:XSL年加入当前的日期

<APPLIN_DT><xsl:value-fof select="format-date(current-date(), '[Y0001]-[M01]-[D01]')"/></APPLIN_DT> 

当前日期也必须进行格式化像“YYYY- MM-DD' 在另一个元素中,我需要currentdate + 1年。 这样做的最佳解决方案是什么?

谢谢!

罗伯特

回答

1

当您使用XSLT 2.0,试试这个...

<APPLIN_DT> 
    <xsl:value-of select="format-date(current-date() + xs:yearMonthDuration('P1Y'), '[Y0001]-[M01]-[D01]')"/> 
</APPLIN_DT> 

凡在xs前缀的名称空间是http://www.w3.org/2001/XMLSchema

相关问题