TIME([option][,time[,option]]) The TIME function has three uses: - to return information about the current local time; - to operate an elapsed time counter, and - to convert a time from one format to another. In order to return information about the current local time, a single optional parameter is supplied whose first letter must match that of one of the formatting options listed below. If the parameter is omitted then 'N' is assumed. Civil - The time in the format hh:mmxx where hh is the hour in 12-hour notation (no leading zero), mm is the minute, and xx is either am or pm. Normal - The time in 24-hour clock format as hh:mm:ss. Long - The time in 24-hour clock format as hh:mm:ss.uuuuuu where uuuuuu is the number of microseconds. Hours - the number of hours since midnight. Minutes - the number of minutes since midnight. Seconds - the number of seconds since midnight. Offset - the current difference (if known) between GMT and local time measured in seconds (positive if local time is ahead). If two or three parameters are supplied then the second parameter is a time which must be in one of the above formats (with the exception that 'O' format is not allowed) and the optional third parameter must state which format it is in. If the third parameter is omitted then 'N' is assumed. If the input time is in 'M' or 'H' format then the seconds and/or minutes values in the result will be filled in with zeros as necessary. This form of the TIME function makes straight conversions and does not take account of any changes in daylight savings time. The elapsed time counter is operated by calling the TIME function with a single parameter whose first letter matches that of either of the following. Elapsed - On the first call the result is 0 and on subsequent calls the result is the elapsed time since then in the format sssss.uuuuuu (no leading zeros). Reset - same as Elapsed, but after the time is calculated, the timer is reset to zero. On the first call to TIME or DATE in an expression, a time stamp is made which is then used for all calls to these functions within that expression. Hence if multiple calls to these functions are made within a single expression, they are guaranteed to be consistent with each other. Note that this means that: say time(e) sleep(2) time(e) x exit sleep:'sleep' arg(1) x=time(e) return "" will type "0 0 2.062564" (perhaps) even though over two seconds elapse during evaluation of sleep(2). Also, the timestamp only applies to time() calls within a single expression, so the line "x=time(e)" is not affected by the timestamp. The elapsed time counter is saved across function calls. This means that although a procedure inherits the elapsed time counter from its caller, if it should reset the clock, this does not affect any timing which may be in progress by the caller. NOTE: The time is subject to the accuracy of the system clock, which may not give a very reliable number of microseconds. The TIME('O') function relies on the operating system to return the correct offset and this may be unknown or inaccurate. The TZ environment variable may have an effect on determining the current timezone.