Developer

@TIME

The TIME function returns either the current system time of the client device, or the time value specified as an optional parameter to the function. The function can also take an optional format parameter when called in a string context. The function supports the integral number, decimal number, and string return types.

When called in an integral or decimal number context, the function will return the number of seconds before (negative value) or after (positive value) the time 12:00:00 AM. This is the Agentry epoch time. When called in a string context, the function will return a time value in the default format for the client device’s locale.

The function’s first parameter, if provided, is a string and contains the time value to be returned by the function.

The second parameter is also optional and is evaluated as a string. It can contain one or more of the time format tokens. The syntax for this parameter is as follows:
t={time format tokens}

The tokens within the curly braces will be used to format the time value returned by the function:

Table 26: Rule Time Format Tokens - All time format tokens are case sensitive
Time Token Description
h Hour of day in 12 hour clock format with no leading zero for single digit hours.
hh Hour of day in 12 hour clock format with leading zero for single digit hours.
H Hour of day in 24 hour clock format with no leading zero for single digit hours.
HH Hour of day in 24 hour clock format with leading zero for single digit hours.
m Minute of the hour with no leading zero for single digit minutes.
mm Minute of the hour with leading zero for single digit minutes.
s Seconds of the minute with no leading zero for single digit minutes.
ss Seconds of the minute with leading zero for single digit minutes.
t One character time marker string, such as A or P.
tt Two character time marker string, such as AM or PM.
non-token characters Any non-token character within the format string is passed through as is; e.g in the following string: t={hh:mm:ss} the resulting string will contain the colon characters separating each time element: 10:12:32

Parameters

    @TIME ([Time String [, Format Tokens] ])
  • Time String Optional string parameter; contains the time value to be returned by the function. To format the current system time, this parameter may be set to a second call to the TIME function. A data definition such as a property or global of type Time or Date and Time may be used for this parameter. The date portion of a Date and Time value will be truncated. A string may be used provided the time is in the format hh:mm:ss. A numeric value may be passed for this parameter, in which case it will be treated as the number of seconds before or after the Agentry epoch time.
  • Format Tokens Optional string parameter; contains the time format tokens that will format the function’s return value when called in a string context. When the function is called in any other context, this parameter is ignored. The Time String parameter must be specified before Format Tokens can be provided.

Supported Return Types

  • Integral Number
  • Decimal Number
  • String