For this topic's original documentation, see the TIM Variable - Get Time of Day.
By default, the TIM variable returns the current server time.
In BBj 12.00 and higher, when using a thin client connection, this can be changed to return the current client time by setting SETOPTS byte 8, bit $08$. Use TIM(MODE="SERVER") or TIM(MODE="CLIENT") to explicitly return either server or client time, independent of the value of the SETOPTS bit.
In BBj 14.00 and higher, the MODE="CLIENT" option is also supported with TermConsole connections. In this configuration, the client time zone is set by the value of the TZ environment variable at the time when the TermConsole session was started.
In BBj 24.00 and higher, the TIME() function can be used to parse a human-readable time string (e.g. "4:45pm") and return a number as defined by the TIM variable.
The BBj TIM variable is accurate to the nearest millisecond, if supported by the host operating system. Because the PRO/5 TIM variable is only accurate to the nearest second, some legacy BBx applications assume that TIM*3600 is guaranteed to evaluate to an integer. This assumption is not valid in BBj.