Finding 'Average' time
Keywords: Finding 'Average' time TimeJulianDay FileYmdHms
Question:
I hope I haven't overlooked something, but I've scoured the help file pretty thoroughly.I'm trying to calculate the average of a list of time stamps in human readable format (YY:MM:DD:HH:MM:SS).
I tried using a flag file, and setting that file's time in human readable time via "filetimeset", then retrieving the machine readable from "filetimecode" for my calculation of mean. The problem with this work around is that there is no way to get machine readable BACK to human readable...Is there? Any help greatly appreciated.
Answer:
- Use FileYmdHms
- Use TimeJulianDay to convert to a Julian date (if interested in longer spans of time. or use TimeDiffSecs to convert to seconds from some standatd point in the past.
- Average the numbers.
- Use TimeJulToYmd to convert back to a standatd format date, ot TImeAdd to regenerate a standard datetime (thi sone is tricky)