util.Datetime.format

Formats a date/time value based on a specified format.

Syntax

util.Datetime.format(
   t DATETIME q1 TO q2,
   format STRING
)
  RETURNS STRING
  1. t is the date/time 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.

Note: The format() method is designed to accept DATETIME values. However, since Genero BDL supports implicit type conversion, it is also possible to pass a DATE value to the format() method.

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