Do not spray with slag technology
- $friday = strtotime("next Friday 18:00:00");
- $time = time();
- $s = $friday-$time;
- $days = floor($ s/24/60/60); //Remaining days
- $hour = floor( ($s-$days*24*60*60)/60/60); //Remaining hours
- $minute = floor( ($ s-$days*24*60*60-$hour*60*60)/60 ); //Remaining minutes
- $second = floor($s-$days*24*60*60-$hour*60*60 -$minute*60); //Remaining seconds
- echo json_encode(array('days'=>$days , 'hour'=>$hour , 'minute'=>$minute , 'second'=> ;$second ));
- ?>
Copy code
- How much longer? Liberation
-
- window.setInterval(function(){
- $.get("djs.php", function(data){
- eval("var data = "+data);
- insert('days' ,data.days);
- insert('hour',data.hour);
- insert('minute',data.minute);
- insert('second',data.second);
- });
- },1000 );
- function insert(id,time){
- var insert = document.getElementById(id);
- insert.innerHTML = time;
- }
- Lijiejie Also: dayshours seconds
-
-
-
|