[ create a new paste ] login | about

Link: http://codepad.org/a7cnWTwm    [ raw code | output | fork ]

regnaog - PHP, pasted on Mar 14:
1
2
3
4
5
6
7
8
9
10
11
<?php


$date1="03/17/2012 9:00 PM";
$date2="03/17/2012 10:20 PM";


$diff_seconds  = strtotime($date2) - strtotime($date1);
echo floor($diff_seconds/3600).' hours and '.floor(($diff_seconds%3600)/60).' minutes';

?>


Output:
1
1 hours and 20 minutes


Create a new paste based on this one


Comments: