need a total for time duration
Posted: Mon Feb 14, 2005 6:23 pm
this should be pretty simple but I'm struggling with it...it is Monday after all.
I have three different fields on my database for time:
1 - hour
2 - minutes
3 - seconds
I am looping over a query and then adding to some local page vars like such:
$hr += $db['hour'];
$min += $db['minutes'];
etc...
I then need to convert all of that into one time duration:
in other words I might have
$hr = 0
$min = 66
$sec = 102343
obviously I need to divide 102343 by 60 to get my minutes and 66 by 60 to get my hours, but I'm really struggling putting this all together...espcially since I'm getting fractions of 100 (and not 60).
any suggestions or help you can provide will be most appreciated.
thx,
Burr
I have three different fields on my database for time:
1 - hour
2 - minutes
3 - seconds
I am looping over a query and then adding to some local page vars like such:
$hr += $db['hour'];
$min += $db['minutes'];
etc...
I then need to convert all of that into one time duration:
in other words I might have
$hr = 0
$min = 66
$sec = 102343
obviously I need to divide 102343 by 60 to get my minutes and 66 by 60 to get my hours, but I'm really struggling putting this all together...espcially since I'm getting fractions of 100 (and not 60).
any suggestions or help you can provide will be most appreciated.
thx,
Burr