I\'m having trouble with calculating the median of a list of values, not the average.
I found this article Simple way to calculate median with MySQL
It has a
First try to understand what the median is: it is the middle value in the sorted list of values.
Once you understand that, the approach is two steps:
Example:
Median of 0 1 3 7 9 10: 5 (because (7+3)/2=5)
Median of 0 1 3 7 9 10 11: 7 (because 7 is the middle value)
So, to sort dates you need a numerical value; you can get their time stamp (as seconds elapsed from epoch) and use the definition of median.