date_default_timezone_set('Europe/Moscow');
function convertSec($time) {
$exp = explode(':', $time);
if ( count($exp) == 3 ) {
return (($exp[0] * 60) * 60) + ($exp[1] * 60) + $exp[2];
}
if ( count($exp) == 2 ) {
return ($exp[0] * 60) + $exp[1];
}
}
a::b(convertSec('5:43:25') . ' ' . '5:43:25' . ' ' . date('H:i:s', convertSec('5:43:25')));
a::b(convertSec('43:25') . ' ' . '43:25' . ' ' . date('i:s', convertSec('43:25')));
a::b(convertSec('0:25') . ' ' . '0:25' . ' ' . date('i:s', convertSec('0:25')));
Результат:
20605 5:43:25 08:43:25 <- тут косяк, не правильный час
2605 43:25 43:25
25 0:25 00:25