Created
August 6, 2020 22:11
-
-
Save caionorder/120adfde1899b24529570b1414aee30a to your computer and use it in GitHub Desktop.
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
<?php | |
function somar_horas($inicio,$fim){ | |
$final = new DateTime(); | |
$inicio = DateTime::createFromFormat('H:i:s', $inicio); | |
$fim = DateTime::createFromFormat('H:i:s', $fim); | |
$val01 = $inicio->getTimestamp(); | |
$val02 = $fim->getTimestamp(); | |
$final_hora = strtotime($val01)+strtotime($val02); | |
pr(date('H:i:s',($final_hora))); | |
die(); | |
$final->setTimestamp($final_hora); | |
echo($final->format('%H:%I:%S')); | |
die(); | |
// return $intervalo->format('%H:%I:%S'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment