How to convert seconds into hours, minutes, and seconds in PHP | PHP programs
Jan 19, 2022
PHP,
3065 Views
How to convert seconds into hours, minutes, and seconds in PHP | PHP programs
How to convert seconds into hours, minutes, and seconds in PHP | PHP programs
We will convert the number of seconds into hours, minutes, and seconds.
<?php
$seconds = 6530;
$secs = $seconds % 60;
$hrs = $seconds / 60;
$mins = $hrs % 60;
$hrs = $hrs / 60;
print ("HH:MM:SS-> " . (int)$hrs . ":" . (int)$mins . ":" . (int)$secs);
?>