Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. <?php
  2.  
  3. $difference = (strtotime($row['Landing']) - strtotime($row['Take_Off']);
  4.  
  5. $hours = ceil($difference/60/60); // rounds the hours to the nearest hour.
  6.  
  7. $minutes = (($difference - ($hours * 60 * 60))/60); // rounds the remainder of the hours to the nearest minutes.
  8.  
  9. $time = $hours.":".$minutes; // puts a : between the hours and minutes.
  10.  
  11. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement