I guess I need to use a more conservative approach
//Set the two dates
//Get 1 day in milliseconds
//Calculate difference btw the two dates, and convert to days
" days has gone by since the millennium!")
Are you sure you want to use Math.ceil? That rounds upward.
I did it this way, which seems to work:
var millennium = new Date(2000, 0, 1);
var today = new Date();
var difference_ms = today - millennium;
var ms_in_a_day = 1000 * 60 * 60 * 24;
var difference_days = Math.round(difference_ms / ms_in_a_day);
document.write("Today is "+ difference_days + " days after the millennium.");
do I need to check to see if that function will work all the time, such as detect the OS in use?