This expression reads a date time sample, and formats it according to what you require. The function takes one parameter which is a date-time format string specifying the date time format that you require. Some typical format strings are:

  • dd/MM/yy (e.g. 03/12/06)
  • dd MMM yy (e.g. 01 Dec 06)
  • dd MMM yyyy, HH:mm (e.g. 01 Dec 2006, 15:45)

Note: the format string must be enclused in quotes, e.g. in format “dd/MM/yy”

A typical use of this expression would be to format today’s date and insert it into a report. For example, the comment

“The cholesterol result was performed on today in format “dd MMM yy”, and was within the normal range”

would evaluate as:

“The cholesterol result was performed on 03 Jun 08, and was within the normal range”

See also:

today

as time

as date

as datetime in format … from format …