Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $start = "12:00";
- $end = "03:00";
- $startUnix = strtotime(date('Y-m-d') ." ". $start);
- $endUnix = strtotime(date('Y-m-d') ." ". $end);
- $time = $endUnix - $startUnix;
- if($time < 0){
- $endUnix += 86400;
- $time = $endUnix - $startUnix;
- echo "Часов: ".$time/(60*60); //Напишет, что между времеными метками 15 часов(след. день)
- } else {
- echo "Часов: ".$time/(60*60);
- }
Add Comment
Please, Sign In to add comment