datetime - Transform seconds in time in PHP -
i have example 259201 seconds
in variable.
how can transform in "normally"
time 4 days 00:00:01
?
thank in advance!
is simple in php:
<?php $secs = "259201"; $days = gmdate("d", $secs); $hoursminssecs = gmdate("h:i:s", $secs); if ($days == 0) { $days = empty($days); } elseif ($days == "1") { $days = "1 day"; } else { $days = $days." days"; } echo $days." - ".$hoursminssecs ?>
hopes helps you!
Comments
Post a Comment