Skip to content

Instantly share code, notes, and snippets.

@yokesharun
Created March 2, 2017 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yokesharun/ae789de0ac0fcb63a433f6b7a883e0e4 to your computer and use it in GitHub Desktop.
Save yokesharun/ae789de0ac0fcb63a433f6b7a883e0e4 to your computer and use it in GitHub Desktop.
Get Hour difference between two dates
$hourdiff = round((strtotime($time1) - strtotime($time2))/3600, 1);
echo $hourdiff;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment