I would like a simple text box input of a date in the past and then for it to display how many days it is from today’s date. I have found several examples of how to use javascript to do it between two dates that you input, but not with only doing one date and today’s.
The current date to track is 4/2/2010, but it will change over time.
If you don’t care about the leap second (
:)), you can simply subtract the current date from the date back then, which gets you the difference in milliseconds, and then divide the difference by the amount of milliseconds that fits in one day: