format()

Formats a Date as a String according to a format specification.

Syntax

String  format(String format)
  1. format is a 4GL-compatible format specification.

Formatting symbols for dates

The formatting symbols can use either uppercase or lowercase letters.

Table 1. Formatting Symbols for Dates
Character Description
dd Day of the month as a two-digit integer.
ddd Three-letter English-language abbreviation of the day of the week, for example, Mon, Tue.
mm Month as a two-digit integer.
mmm Three-letter English-language abbreviation of the month, for example, Jan, Feb.
yy Year, as a two-digit integer representing the two trailing digits.
yyyy Year as a four-digit number.

Example

The following expression formats the value of the variable orderline.orders.orderdate to DD MMM YY, for example, "12 Feb 19":

Date.orderline.orders.orderdate.format("DD MM YY")