util.Datetime.format

Formats a datetime value based on a specified format.

Syntax

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

Usage

The util.Datetime.format() method formats a DATETIME 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 DATETIME values.

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

Example

IMPORT util
MAIN
    DISPLAY util.Datetime.format( CURRENT, "%Y-%m-%d %H:%M" )
END MAIN