Calculate average time

0
  Hi I have time data in the form of hh:mm.  And I have to find the average of those times. What should I do?
asked
1 answers
1

You can use the dateTimeToEpoch functions to convert your datetimes to decimal/integer values. Then do your calculation and change it back to a dateTime afterwards.

For example, this would give you the average of two dates:

epochToDateTime(round((dateTimeToEpoch($date1) + dateTimeToEpoch($date2)) div 2))

 

answered