Chuck,
Thanks for the insight. After reading your post I had a little deeper look around and was able to sort out a solution. I thought I would post it hear as it seems to be a fairly common business problem which one might need to solve.
I added the following Java Script to Module Configuration / Custom Java Script File / Initial Java Script :
$(parkingDuration) = Math.ceil(((Date.parse($(datefieldreturn)) - Date.parse($(datefielddeparture))) / (((1000*60)*60)*24)))
I want to calculate the duration between a departure date and a return date for a trip. I used the Date.parse function to convert each date to milliseconds. Once the data is in milliseconds it is easy to just subtract the two numbers. The only trick is once the milliseconds are subtracted, you have to divide it by the number of milliseconds in a day which is 1000 * 60 seconds * 60 minutes * 24 hours.
I have a page where a person specifies the departure and return dates, and then hits a button to display the price quote. The button click redirects to a sub page which displays the quote. This sub page executes the above java script on page load and does the calculations.
Thanks again for the help, I hope sharing this will help save someone else some time in the future.
Regards
Jeff Wingo
http://www.BorngeTech.com