secondsConvert will return (hours*60*60)+(minutes*60)+seconds.PHP Code:<?php
function secondsConvert($time){
$seconds = explode(':', $time);
$total_seconds = 0;
$total_seconds += $seconds[0] * (60 * 60);
$total_seconds += $seconds[1] * 60;
$total_seconds += $seconds[2];
return $total_seconds;
}
$time = date("H:i:s");
echo secondsConvert($time)." seconds";
?>



Reply With Quote

Bookmarks