<div class= "Time Timers" rel= "<?php echo date (' m/d/y ', Time () +24*3600)?>" > <span class= "Ico_time" ></span> <span class= "Data_title" > Remaining <span class= "Data_pink Pi Nkft "><span class=" hours ">7</span> <span class=" mins ">46</span> sub <span class=" "> 33</span> sec </span>
</span> </span> </div>
Here is the JS code
$ (document). Ready (function () {timing ();}); /Countdown function timing () { $ (". Timers"). each (function () { var endtime = new Date ($ (thi s). attr ("rel")). GetTime (); var nowtime = new Date (); var Youti me = 0; Youtime = endtime-nowtime; &NBSP ; var seconds = youtime/1000; var minutes = Math.floor (SECONDS/60); VA R hours = Math.floor (MINUTES/60); var chour= hours% 24; var cminute = minutes% 60; var csecond= math.floor (seconds%60);//"%" var ms=math.floor (youtime)% 10; if (endtime<=nowtime) { //$ (this). HTML ("expired")// If the end date is less than the current date, the prompt expires }else{ $ (this). HTML ("Still <span class= ' pinkft data_pink ' ><span class= ' hours ' >" +chour+ "</span> <span class= ' mins ' > "+cminute+" </span> <span class= ' > ' +csecond+ '. ' +ms+ "</span> sec </span>"); if (Chour <) { $ ("#hours"). Text ("0" +chour); }else{ &NBS P $ ("#hours"). Text (chour); } if (Cminute < ten) { $ ("#minute"). Text ("0" +cminute); nbsp }else{ $ ("#minute"). Text (Cminute ); } if (Csecond <) { &N Bsp $ ("#second "). Text (csecond+ '. ') +MS); }else{ $ ("#second"). Text (csecond+ '. ') +MS); } } }); setTimeout ("Ti Ming () ", 100);}
JS countdown function source code