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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -