I use some code to subtract one date from another using XSLT 2.0:
<xsl:template match="moveInDate">
<xsl:value-of select="current-date() - xs:date(.)"/>
</xsl:template>
This works, however, leaves me with the answer of P2243D, which, I believe, corresponds to the β2243 day periodβ (which is true in mathematics).
Since I only need the number of days, not P and D, I know that I can use a substring or something similar, but as a newbie to XSLT, I am curious if there is a better, more elegant way to do this than simple manipulations with string.
source
share