Created
May 13, 2016 00:55
-
-
Save turtlix/a0c6af816fcb431d5208dff5f397e10b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
function dateDiff($date1, $date2){ | |
$datetime1 = new DateTime($date1); | |
$datetime2 = new DateTime($date2); | |
$interval = $datetime1->diff($datetime2); | |
return $interval->format('%H:%I'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment