Created
December 28, 2016 09:52
-
-
Save csalgueiro/1f5cfc9e45f51d349cdfc90527fff44d to your computer and use it in GitHub Desktop.
diferencia de horas php con strtotime
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
$hora_ini = "08:15"; | |
$hora_fin = "09:30"; | |
$fecha = date("Y-m-d"); | |
$ts_fin = strtotime($fecha." ".$hora_fin); | |
$ts_ini = strtotime($fecha." ".$hora_ini); | |
echo "TS_INI: ".$ts_ini."<br>"; | |
echo "TS_FIN: ".$ts_fin."<br>"; | |
echo "DIFF: ".($ts_fin-$ts_ini)/3600; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment