I am using http://nithinbekal.com/2009/javascript-how-to-create-a-simple-countdown-timer/ But when I run it in firefox I get the error Data.parse is not a constructor. So what will I need to do to solve this?
<script type="text/javascript">
function updateWCTime() {
now = new Date();
kickoff = new Date.parse("June 11, 2012 11:30:00");
diff = kickoff - now;
days = Math.floor( diff / (1000*60*60*24) );
hours = Math.floor( diff / (1000*60*60) );
mins = Math.floor( diff / (1000*60) );
secs = Math.floor( diff / 1000 );
dd = days;
hh = hours - days * 24;
mm = mins - hours * 60;
ss = secs - mins * 60;
document.getElementById("ct").innerHTML = dd + " days " + hh + " hours " + mm + " minutes " + ss + " seconds";
}
setInterval(function() { updateWCTime() }, 1000 );
Remove new from this line. Date.parse is just a method.
kickoff = Date.parse("June 11, 2012 11:30:00");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With