Function |
Description |
Syntax |
Examples |
---|---|---|---|
TIME |
Returns the time specified by the given hour, min, and sec. |
TIME(hour,min,sec) |
TIME(14,30,45) == 14:30:45 Compiles the current time according to the hour, minute and second values into a formatted time. In this case, the following might be returned: 14:30:45 |
TADD |
Increases/decreases a time value by the specified number of time (t) units. The unit part is optional and defaults to ‘H’ (hours). |
TADD (t,n,[unit]) where unit is one of the items listed in the Time Units table |
TADD(@CREATE_TIME,13,'H') Adds 13 hours to the value returned. In this case, 10:17:22 would be converted to 23:17:22 (default HH:NN:SS format) |
TGET |
Returns the numeric value of the specified time (t) unit. |
TGET(t,unit) where unit is one of the items listed in the Time Units table |
TGET(@CREATE_TIME,'S') Returns only the value of the specified time unit from within the time value. In this case, 14:30:45 would return 45, while 10:15:12 would return 12 |
TSTR |
Converts a time object to a formatted string. The format part is optional, and defaults to 'TIME'. |
TSTR (t,[format]) where format is one of the items listed in the Time Formats table |
TSTR(@TIME_FIELD,'H12:NN AM') Converts the time value returned to a string. In this case, 14:30:45 would be converted to 2:30 PM |
TSUB |
Returns the difference between two time objects, in the specified time unit. The unit part is optional and defaults to ‘H’ (hours). |
TSUB (t1,t2,[unit]) where unit is one of the items listed in the Time Units table |
TSUB(NOW(),@CREATE_TIME,'S') Calculates the difference in the two time objects, specified here, in seconds. In this case, values of 14:30:45(now) and 12:45:15 for these two fields would return 6330 |
TVAL |
Converts a string containing a time value to a time object. |
TVAL(str) |
TVAL(@TIME_FIELD) Converts a string containing a time value to a time object. For example, 14:30 would be converted to the standard time format: 14:30:00 |
TNOW |
Returns the current time. |
TNOW() |
TNOW() Returns the current time, such as: 08:40:10 |