Archive for June 17th, 2007

Displaying The Days Between Two Dates Via JavaScript / DOM

Recently asked on Yahoo! Answers:

What are the MS Office Frontpage JavaScript codes needed to calculate the number of days between two dates?

I am not a programmer, but i need the codes and add it to an existing webpage format. What i need exactly is to show in the page a kind of table identifying a date in the future, the current date, and the number of days (the difference between the two dates) from the current date to the mentioned future day. Its like a countdown on how many days are left before that future date comes…

This is very easy to accomplish via JavaScript; because JavaScript treats time as an integer, it’s all just math, plus changing the values of a couple of DIVs via JavaScript’s DOM manipulation abilities. So let’s get right to it.

Read the rest of this entry »