Date Time Php

function timeConversion($gvnSeconds)
{
$hrs = (int) ( $gvnSeconds / 3600 ) ;
$mins = (int) ( ($gvnSeconds/60) - ( $hrs * 60 ) ) ;
$secs = (int) ( $gvnSeconds % 60 ) ;
$daily = $hrs . ":" . $mins . ":" . $secs ;
return $daily ;
}
function weeklyTimeConversion($gvnSeconds)
{
$day = $gvnSeconds / 86400;
switch ((INT)$day)
{
case 0:
$days = "Sunday" ;
break;
case 1:
$days = "Monday" ;
break;
case 2:
$days = "Tuesday" ;
break;
case 3:
$days = "Wednesday" ;
break;
case 4:
$days = "Thursday" ;
break;
case 5:
$days = "Friday" ;
break;
case 6:
$days = "Saturday" ;
break;
}
$hrs = ( $gvnSeconds - ((int)$day * 86400)) / 3600 ;
$mins = ( $gvnSeconds - ((int)$hrs * 3600) - ((int)$day * 86400 ))/ 60 ;
$secs = ( $gvnSeconds - ((int)$mins * 60 ) - ((int)$hrs * 3600) - ((int)$day * 86400 ));
$weekly = $days . " " . (int)$hrs . ":". (int)$mins . ":" . (int)$secs ;
return $weekly ;
}
// Output On : Sunday 10:10:00
echo " On : " . weeklyTimeConversion("36600");
// Output Daily @ 20:10:00
echo " Daily @ : " . timeConversion("72600");
?>