Skip to content

Instantly share code, notes, and snippets.

@dragosani24
Last active February 8, 2020 00:41
Show Gist options
  • Select an option

  • Save dragosani24/c972bed0447b18f976bb458b0bea622e to your computer and use it in GitHub Desktop.

Select an option

Save dragosani24/c972bed0447b18f976bb458b0bea622e to your computer and use it in GitHub Desktop.
PHP: Cálculo de la diferencia de horas entre dos tiempos
<?php
$time1 = strtotime('08:00:00');
$time2 = strtotime('09:30:00');
$difference = round(abs($time2 - $time1) / 3600,2);
echo $difference;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment