> I have a value 178607, which is stored as seconds. I
> like to convert it (178607 Secs) to Hours, Minutes and
> Seconds appropiatly.
> Can anybody help me supplying the code?
If it's stored in MySQL, you can use SEC_TO_TIME()
mysql> select sec_to_time(178607);
+-+
| sec_to_t
function secondstohours($seconds)
{
/* [EMAIL PROTECTED] */
$sec=$seconds%3600;
return (($seconds-$sec)/3600).':'.($sec/60).':'.($sec%60);
}
echo secondstohours(7500);
Op dinsdag 03 juni 2003 14:38, schreef u:
> Hello everybody,
> I have a value 178607, which is stored as
Hi Chinmoy,
> I have a value 178607, which is stored as seconds. I
> like to convert it (178607 Secs) to Hours, Minutes and
> Seconds appropiatly. Can anybody help me supplying the code?
Try something like this:
";
echo sec2hms(60). "";
echo sec2hms(66). "";
echo sec2hms(3600). "";
echo
Hello everybody,
I have a value 178607, which is stored as seconds. I
like to convert it (178607 Secs) to Hours, Minutes and
Seconds appropiatly.
Can anybody help me supplying the code?
Thank You,
- Chinmoy
__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar wi
4 matches
Mail list logo