MediaWiki:Countdown.js

var dt = new Date('2015-06-30T17:00:00Z'); var $target = $('#countdown'); showTime; setInterval( function {	showTime; }, 1100); function showTime { var dateNow = new Date; var timeDiff = Math.abs(dt.getTime - dateNow.getTime); var hours = Math.floor( timeDiff / 36e5 ); var mins = Math.floor( (timeDiff % 36e5) / 6e4 ); var secs = Math.floor( (timeDiff % 6e4) / 1000 ); $target.html( ' (' + hours + 'h, ' + ' ' + mins + 'm, ' + ' ' + secs + 's' + ')'); }