util.Interval.format

Formats an interval value based on a specified format.

Syntax

util.Interval.format(
   t INTERVAL q1 TO q2,
   format STRING
)
  RETURNS STRING
  1. t is the interval value to be formatted.
  2. format is the format string, as described in Formatting INTERVAL values.

Usage

The util.Interval.format() method formats an INTERVAL value based on the format specification.

The format string must be a combination of place holders such as %Y, %m, %d, as described in Formatting INTERVAL values.

If the source value is NULL the result will be NULL.

Example

IMPORT util
MAIN
    DEFINE iv INTERVAL DAY(6) TO MINUTE
    LET iv = "-157 11:23"
    DISPLAY util.Interval.format(iv, "%d %H:%M")
END MAIN