If you trust this link, click it to continue.
https://stackoverflow.com/questions/79419350/calculate-mean-time-of-day-in-hms-in-r