lol sorry i posted it accidentally
I'm new to JavaScript and i'm trying to make a simple countdown script that should show the difference between the end date and today's server date.
here is a great example of what i'm trying to do http://moblog.bradleyit.com/2009/06/javascripting-to-find-difference.html
The only thing i want to add is another variable with a calculated seconds. How can i do that?
Here is the code:
var today = new Date(); var Christmas = new Date("12-25-2009"); var diffMs = (Christmas - today); // milliseconds between now & Christmas var diffDays = Math.round(diffMs / 86400000); // days var diffHrs = Math.round((diffMs % 86400000) / 3600000); // hours var diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes alert(diffDays + " days, " + diffHrs + " hours, " + diffMins + " minutes until Christmas 2009 =)");