...

View Full Version : dividing a time value



PaulC2K
01-05-2008, 02:41 AM
Hi,

Im trying to take a value which ive got from date("H:i.s") and i need to divide and possibly at some point multiply this value by another variable.

I've tried a few things, but i havent really played with the different time/date functions and i havent found one which appears to do what i want, or at least i havent given it the correct information to get the results i'd expect.

I tried:

$average = date("H:i.s", strtotime($time_passed) * 0.5);
which i suspected would have made $average half the value it originally was, but as you probably know or at least guessed from me posting asking for help, that doesnt work.

I know i could break it down into seconds and divide the value then rebuild it back into Min:sec:mss but im hoping theres a real simple way of doing it that ive not fallen upon.

Anyone have any ideas?

Thanks,
PaulC2K

bcarl314
01-05-2008, 05:26 AM
I know i could break it down into seconds and divide the value then rebuild it back into Min:sec:mss but im hoping theres a real simple way of doing it that ive not fallen upon.


That's probably a good approach.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum