Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: dividing a time value
01-05-2008, 01:41 AM #1
- Join Date
- Jul 2005
- Thanked 0 Times in 0 Posts
dividing a time value
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.
$average = date("H:i.s", strtotime($time_passed) * 0.5);
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?
01-05-2008, 04:26 AM #2
- Join Date
- Jun 2002
- Winona, MN - The land of 10,000 lakes
- Thanked 45 Times in 42 Posts
That's probably a good approach.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.