<Scripttype= "Text/javascript" > varIntdiff=parseint (1800); //Countdown total number of seconds functionTimer (intdiff) {varF=Window.setinterval (function() { var //Day = 0,Hour= 0, Minute= 0, Second= 0; //Time Default Value if(Intdiff> 0) { Day=Math.floor (Intdiff/ ( - * - * -)); Hour=Math.floor (Intdiff/ ( - * -)) -( Day* -); Minute=Math.floor (Intdiff/ -) -( Day* - * -) -(Hour* -); Second=Math.floor (Intdiff)-( Day* - * - * -) -(Hour* - * -) -(Minute* -); }Else{Console.log ('clear the timer.') Window.clearinterval (f); } if(Minute<= 9) Minute= '0' +minute; if(Second<= 9) Second= '0' +second; //$ (' #day_show '). HTML (day + "Days"); $('#hour_show'). HTML ('0'+hour); $('#minute_show'). html (minute); $('#second_show'). HTML (second); Intdiff--; }, +); } $(function() {timer (Intdiff); }); </Script>
Implementation of the timer
Time and seconds timer