954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Xpath or XSLT Count Help Between Two Dates

Need help counting the # of days between two dates (ex: 1/2/10 and 1/24/10)

Better yet, the # of hours would be a great alternative.

reeves14
Newbie Poster
1 post since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

XSLT1.0 does not have built-in date arithmetic. Have a look at http://exslt.org/date/index.html fo extension functions which handle dates. Some of the functions should enable you to do what you want to do.

XSLT2.0 has the subtract-dates series of functions

fpmurphy
Junior Poster
147 posts since Oct 2008
Reputation Points: 22
Solved Threads: 11
 

Above poster is correct. The EXSLT.org is the best place to go for 1.0 date manipulation..

If what you need isn't there, you can always use what they do have and make your own function. If you have trouble constructing something, let us know. If you're a heavy user of XSLT 1.0 and have to do date things, I really recommend this book.

XSLT Cookbook
http://www.amazon.com/XSLT-Cookbook-Sal-Mangano/dp/0596003722

It's a really great collection of "recipes" that solve tons of common programing problem in XSLT 1.0

iceandrews
Junior Poster
185 posts since May 2010
Reputation Points: 10
Solved Threads: 30
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: