code_junkie

How to get time difference in minutes in PHP

Nov 12th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. print("<?php
  2. $to_time=strtotime("2008-12-13 10:42:00");
  3. $from_time=strtotime("2008-12-13 10:21:00");
  4. echo round(abs($to_time - $from_time) / 60,2)." minute";
  5. ?>");
  6.  
  7. <?php
  8. $date1 = time();
  9. sleep(2000);
  10. $date2 = time();
  11. $mins = ($date2 - $date1) / 60;
  12. echo $mins;
  13. ?>
Add Comment
Please, Sign In to add comment