Skip to content

Instantly share code, notes, and snippets.

@kidker
Created September 20, 2017 11:24
Show Gist options
  • Save kidker/30a3ee9e263f9588df2ca353253ab069 to your computer and use it in GitHub Desktop.
Save kidker/30a3ee9e263f9588df2ca353253ab069 to your computer and use it in GitHub Desktop.
Difference Between Two Timestamps PHP
$ts1 = strtotime($start);
$ts2 = strtotime($end);
$seconds_diff = $ts2 - $ts1;
$time = ($seconds_diff/3600);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment