WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Time - Timer and Date Functions
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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:

  1. Use FileYmdHms

  2. 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.

  3. Average the numbers.

  4. Use TimeJulToYmd to convert back to a standatd format date, ot TImeAdd to regenerate a standard datetime (thi sone is tricky)

Article ID:   W15721
File Created: 2003:05:13:11:29:50
Last Updated: 2003:05:13:11:29:50