PHP - jak odečíst hodinu a čtvrt z času
$cas = strtotime('12:00') - strtotime('01:15');echo date('h:i', $cas);Tohle mi tedy vrátí 11.45, jak na to?
ODPOVĚĎ
Ahoj,
můžeš to udělat třeba takto:
public function getCas($cas,$odecist)
{
$cas = date($cas);
$cas = strtotime($cas . " - $odecist minutes");
return date('h:i', $cas);
}
Komentáře (0)
Přidat komentář