I having some problems with datediff, i have two dates one of which being currentdate and the other is just from a nodefield.
What i need is to get the difference between the dates but in the format of days:hours:mins:seconds as a whole, i can get each individual version for example days or minutes but i need it as one string for a countdown jquery plugin.
Is this possible if so how! Below code is what im using to get the difference in complete days
Date difference
Hi all,
I having some problems with datediff, i have two dates one of which being currentdate and the other is just from a nodefield.
What i need is to get the difference between the dates but in the format of days:hours:mins:seconds as a whole, i can get each individual version for example days or minutes but i need it as one string for a countdown jquery plugin.
Is this possible if so how! Below code is what im using to get the difference in complete days
<h3>Deal Expires In</h3>
<xsl:variable name="currentDate" select="substring-before(umbraco.library:CurrentDate(), 'T')"/>
<xsl:variable name="futureDate" select="umbraco.library:FormatDateTime($currentPage/expireDate, 'yyyy-MM-dd')"/>
<xsl:variable name="diffSeconds" select="umbraco.library:DateDiff($futureDate, $currentDate, 's')"/>
<p>Expires in: <xsl:value-of select="floor($diffSeconds div (60 * 60 * 24))"/> days</p>
Thanks
Pete
is working on a reply...