0

Hi all,

I have 2 xsl variables (currentBillDate and lastBillDate), both having access to dates in format of yyyy-mm-dd.
How can I calculate the number of days in between both days?

Example: 2006-08-28 - 2006-11-06

I tried it this way but it kept giving me NaN

<xsl:value-of select="$currentBilldate - $lastBillDate" />

Any help would be greatly appreciated

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by fpmurphy
0

If you are using XSLT1, the easiest way is to use the date:difference() in EXSLT. If you are using XSLT2 the subtraction of two dates gives a xs:dayTimeDuration which a ISO 8601 truncated format PnDTnHnMnS, where nD represents the number of days, T is the date/time separator, nH the number of hours, nM the number of minutes and nS the number of seconds.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.