figured out my own problem.
Solution for those who want to know...
best way to do this is in seconds.
you take the number of seconds at start subtract it from the number of seconds at end eg:
endseconds-startseconds
then depending on how you want it divded up (I Did Quarter hours)
you get :
if ($ans >= 900) { # each 1/4 hr
while($ans >= 900) {
$hrs++; # increment hours
$ans-=900; # decrement by 1/4 hour
}
$hrs/=4; # 1/4 of hour
$ans=$hrs;
}
/*
Seconds =
300 = 5 minutes / ?? hr
900 = .25 hr / 15 minutes
1800 = .5 hr/30 minutes
3600 = 1 hr/60 minutes
4500 = 1.25 hrs
5400 = 1.5 hr
6300 = 1.75 hrs
7200 = 2 hrs
9000 = 2.5
10800 = 3 hrs
12600 = 3.5
14400 = 4 hrs
...
28800 = 8 hrs
...
57600 = 16 hrs
...
86400 = 24 hrs (1 day)
...
*/