Question: How much time is left, if only PHP is used to output, but the dynamic effect is not visible.
Workaround, use the acquired time minus the current time JS time format conversion
PHP time commodity distance seconds to kill time
<input name= "test01" value= "1472572800/x x/of the start of the day" >
<div id= "Showtimes" ></div>
functionShow_cur_times () {//Get Current date varDate_time =NewDate (); varCur_time =$ ("[Name= ' test01 ']"). Val () *1000; Gets the timestamp to change the millisecond to 000 displayvartimestamp=NewDate (). GetTime (); varTimestampend = Cur_time-timestamp; varNewTime =NewDate (timestampend); varDay=math.floor (timestampend/(24*3600*1000));//calculate the number of hours varleave1=timestampend% (24*3600*1000);//number of milliseconds remaining after counting days varHours=math.floor (leave1/(3600*1000));//calculate the number of minutes difference varleave2=leave1% (3600*1000);//number of milliseconds remaining after hours of calculation varMinutes=math.floor (leave2/(60*1000));//calculate the number of seconds difference varleave3=leave2% (60*1000);//Count the number of milliseconds left after the number of minutes varSeconds=math.round (leave3/1000);varDate_str = day+ "Day" +hours+ "+minutes+" minute "+seconds+" seconds "; //displayed in a container with ID showtimesdocument.getElementById ("Showtimes"). innerhtml=date_str;}//Set 1-second call once Show_cur_times functionSetInterval (show_cur_times,1000);
Dynamic 67 days 12:10 21 seconds
JS Stamp and PHP timestamp time conversion