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.

Recommended Answers

All 2 Replies

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.