util.Interval.format

Formats an interval value according to format specification.

Syntax

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

Usage

The util.Interval.format() method formats an INTERVAL value according to 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