miamaria
03-12-2003, 12:31 PM
I've used a script from Javascript Kit "Count down to my birthday"
and the first part looks like this:
var now = new Date();
var birthd = new Date("March 31, 2003");
var toGo = birthd.getTime() - now.getTime();
var days = Math.floor(toGo / (1000 * 60 * 60 * 24));
Problem is, when calculating the days left to the 31st of March 2003, it comes up with one day less than correct. Example:
Todays the 12th of March - and the counter says it's 18 days left to (my sons) birthday, when in fact it's 19 . How do I change it without changing the "var birthd to April 01, 2003"?
The full script I used is on http://wsabstract.com/script/script2/countbirth.shtml
Thanks a bunch!:thumbsup:
and the first part looks like this:
var now = new Date();
var birthd = new Date("March 31, 2003");
var toGo = birthd.getTime() - now.getTime();
var days = Math.floor(toGo / (1000 * 60 * 60 * 24));
Problem is, when calculating the days left to the 31st of March 2003, it comes up with one day less than correct. Example:
Todays the 12th of March - and the counter says it's 18 days left to (my sons) birthday, when in fact it's 19 . How do I change it without changing the "var birthd to April 01, 2003"?
The full script I used is on http://wsabstract.com/script/script2/countbirth.shtml
Thanks a bunch!:thumbsup: