TIM Variable


For this topic's original documentation, see the TIM Variable - Get Time of Day.

BBj-Specific Information

Syntax

TIM
TIM(MODE="SERVER")
TIM(MODE="CLIENT")

Description

By default, the TIM variable returns the current server time.

In BBj 12.0 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.0 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.

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.

Examples

>PRINT TIM
14.50
>PRINT TIM(MODE="CLIENT")
11.50
>PRINT TIM(MODE="SERVER")
14.50

See Also

Variables - Alphabetical Listing



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.