Averaging a HH:mm:ss field

Can do an average of a HH:mm:ss field?
HHmmss.jpg


sjcrn (BOB member since 2008-12-01)

Based on your samples I assume that the times you want to average are elapsed times for some event and not calendar times.

My first thought would be to convert the times into seconds and find the average value, you can then convert the seconds back to hh:mm:ss.

To get to seconds do something like hh3600 + mm60 + ss


jwhite9 :us: (BOB member since 2006-07-28)

Yes, can be done in steps:

  1. Convert HH:mm:ss into seconds. So for instance time 02:30:59 will be 9178 seconds.
  2. Do the average of the seconds you got in the step 1
  3. Convert the result of step 2 into HH:mm:ss format

Marek Chladny :slovakia: (BOB member since 2003-11-27)

Can you explain your calculation please?

23600 = 7200+
30
60=1800+
59

= 9059???

What am I missing??


SarahG :australia: (BOB member since 2005-08-22)

He he, right :slight_smile:
Maybe I was writing something else than what I was thinking about… 8)


Marek Chladny :slovakia: (BOB member since 2003-11-27)