Iban Cardona i Subiela
Links
Home site
Tuesday, 10 May 2016
PHP: String HH:MM:SS to hours (float)
Hello,
How to parse string with format HH:MM:SS to hours:
$string = '01:58:03';
sscanf($string, "%d:%d:%d", $hours, $minutes, $seconds);
$hours = $hours + $minutes/60 + $seconds/3600
;
Best regards!
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)