Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2010, 10:15 PM
Authorized User
 
Join Date: Apr 2008
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default 3 days prior datetime from current datetime

Hi,

I have to get the datetime of before 3 days from the current-dateTime().

eg: if current date time is 2010-06-10T22:13:17.501-04:00, I have to get 3 days prior date as 2010-06-07T22:13:17.501-04:00.

I am not able to find any function in xslt to retrieve this. Any suggestion would be of great help.

thanks,
Sridhar.
 
Old June 11th, 2010, 02:13 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

Check if the below works:
Code:
<xsl:value-of select="xs:dateTime(current-dateTime()) - xs:dayTimeDuration('P3DT0H')"/>
__________________
Rummy
 
Old June 11th, 2010, 11:26 PM
Authorized User
 
Join Date: Apr 2008
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Thumbs up

Thank you, it worked!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I compare a datetime to current datetime and find the one closest to it? Anders XSLT 17 March 15th, 2010 10:28 AM
how to get current-dateTime() in xsl 1.0 himabindu XSLT 3 September 5th, 2008 05:04 AM
DateTime RickP SQL Server 2000 7 December 14th, 2005 07:08 PM
UTC DateTime to Local DateTime r_ganesh76 SQL Server 2000 1 April 4th, 2005 08:21 AM
DateTime DARSIN General .NET 1 December 1st, 2004 06:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.