I have multiple times as a string:
"2018-12-14 11:20:16","2018-12-14 11:14:01","2018-12-14 11:01:58","2018-12-14 10:54:21"
I want to calculate the average time difference between all these times. The above example would be:
2018-12-14 11:20:16 - 2018-12-14 11:14:01 = 6 minutes 15 seconds
2018-12-14 11:14:01 - 2018-12-14 11:01:58 = 12 minutes 3 seconds
2018-12-14 11:14:01 - 2018-12-14 11:01:58 = 7 minutes 37 seconds
(375s+723s+457s)/3 = 518.3 seconds = 8 minutes 38.33 seconds (If my hand math is correct.)
I have all the datestrings in an array. I assume it's easy to convert it to a timestamp, loop over it to calculate the differences and then the average? I just began to learn python and this is the first program that I want to do for myself.