Time Functions in Integrator
The following functions in Integrator Calcs require that the time argument given is in the standard time format (HH:MM:SS).
Returns the elapsed time between two dates and times. date1 and date2 are in standard date format, and time1 and time2 are in standard time format. If both dates are not null, the difference between the dates will be included in the elapsed time. If both times are not null, then the difference in the times will be included in the elapsed time. The result will be returned as a standard time string. If the first date time pair is later than the second date time pair, a null string is returned.
elapsed_time(date1 : string, time1 : string, date2 : string, time2 : string) : string
For example:
elapsed_time("2007/06/25","10:25:00","2007/06/25","23:30:00") returns 13:05:00
elapsed_time("1995/12/31","23:59:00","1996/01/01","00:00:00") returns 0:01:00
elapsed_time("2006/07/04","00:00:00","2006/07/05","00:00:00") returns 24:00:00
elapsed_time("2007/06/20","23:30:00","2007/06/20","10:25:00") returns ""(empty string)
elapsed_time ("2006/10/12",,"2006/10/14",) returns a syntax error
elapsed_time ("2006/10/12","","2006/10/14","") returns 48:00:00
elapsed_time (,"10:25:00",,"08:25:00") returns a syntax error
elapsed_time ("","10:25:00","","08:25:00") returns a null value
elapsed_time ("","08:25:00","","10:25:00") returns 2:00:00
Formats the string timestring according to the given format and returns a standard time string in the format of HH:MM:SS. If timestring is null, a null string is returned.
format_time(timestring : string, format : string) : string
For example:
format_time("10:25", "hh:mm") returns 10:25:00
format_time("01 01 25 32", "dd hh mm ss") returns 25:25:32
format_time(TOD, "hh:mm") where "TOD" contains 22:10, returns 22:10:00
format_time("3600", "s") returns 1:00:00
format_time("65", "m") returns 1:05:00
format_time("8am", "h") returns 8:00:00
format_time("8pm", "hhpp") returns 20:00:00
format_time("12:47 am", "hh:mm pp") returns 00:47:00
format_time("8am", "m") returns 0:08:00
format_time("99:99", "hh:mm") returns 100:39:00
format_time("Elvis", "hhmm") returns 0:00:00
format_time("9:9:9", "") returns 0:00:00
format_time("", "hh") returns null
Returns, as a number, the number of hours in a standard time string.
hours(time : string) : numeric
For example:
hours("20:15:05") returns 20
Returns the time for a Meditech time expressed in 9 digit format. The input is the number of seconds from the beginning of March 1, 1980. This function returns the time of day in standard DI format (HH:MM:SS).
meditech_time(meditech_time : numeric) : string
For example:
meditech_time(780684178) returns 16:42:58
meditech_time(881795289) returns 23:08:09
Returns, as a number, the number of minutes in a standard time string.
minutes(time : string) : numeric
For example:
minutes("20:15:05") returns 15
Returns the time a specified calculated object starts in a standard time string (HH:MM:SS).
Returns, as a number, the number of seconds in a standard time string.
seconds(time : string) : numeric
For example:
seconds("20:15:05") returns 5
Adds two standard time strings together and returns a standard time string.
time_add(time1 : string, time2 : string) : string
For example:
time_add("11:00:00","12:00:00") returns 23:00:00
Subtracts two standard time strings and returns a standard time string (time1 - time2). If time1 is smaller than time2, a null string is returned. Times cannot be negative; no value is returned.
time_sub(time1 : string, time2 : string) : string
For example:
time_sub("23:00:00", "12:00:00") returns 11:00:00
Converts a standard time string into a number of seconds.
time_value(time : string) : numeric
timevalue(time : string) : numeric
For example:
time_value("00:00:20") returns 20
time_value("00:05:00") returns 300
timevalue("01:00:00") returns 3600
timevalue("24:00:00") returns 86400