A gadget that calculates how long it will take until you get off work

WBOY
Release: 2016-07-25 08:50:30
Original
1175 people have browsed it
Do not spray with slag technology
  1. $friday = strtotime("next Friday 18:00:00");
  2. $time = time();
  3. $s = $friday-$time;
  4. $days = floor($ s/24/60/60); //Remaining days
  5. $hour = floor( ($s-$days*24*60*60)/60/60); //Remaining hours
  6. $minute = floor( ($ s-$days*24*60*60-$hour*60*60)/60 ); //Remaining minutes
  7. $second = floor($s-$days*24*60*60-$hour*60*60 -$minute*60); //Remaining seconds
  8. echo json_encode(array('days'=>$days , 'hour'=>$hour , 'minute'=>$minute , 'second'=> ;$second ));
  9. ?>
Copy code
  1. How much longer? Liberation
  2. Lijiejie Also: dayshours seconds
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!