Skip to content

Instantly share code, notes, and snippets.

View rodrigozem's full-sized avatar
🎯
Focusing

Rodrigo rodrigozem

🎯
Focusing
View GitHub Profile
@rodrigozem
rodrigozem / minutes_from_hh_mi
Last active May 3, 2021 18:13
Retorna os minutos da hora (PHP)
/* Return total minutes */
function get_minutes($hr)
{
$time = explode(":",$hr);
$t1 = intval($time[0]) * 60;
$t2 = intval($time[1]);
if ( strpos($t1,'-') !== false )
return $t1 - $t2;
else
return $t1 + $t2;