[PHP-WIN] Re: [PHP] Time formatting from int (seconds)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> In my case I have the result of a subtraction of two
> date in which seconds are returned as in 980 seconds,
> 576 seconds etc. To make this readable to the user of
> the web page and so they do not need to mentally
> calculate the HHMMSS.

function duration($amount)
{
$offset = 255600;
return date("%H:%M:%S",$amount+$offset);
}

echo duration(980);



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux