Created
September 26, 2011 09:04
-
-
Save credmp/1241898 to your computer and use it in GitHub Desktop.
Simple time calculations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$start = strtotime('10:31'); | |
$end = strtotime('15:23'); | |
echo "Time spent in seconds: " . ($end - $start); | |
echo " Time spent in minutes: " . (($end - $start) / 60); | |
echo " Time spent in hours: " . (($end - $start) / (60*60)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment