Skip to content

FormatDate - Built-in Formatting Function

Purpose

Formats a date using the Windows locale settings or supplied mask.

Syntax

FormatDate(exp,type[,mask])

Arguments

Argument Required Description
exp Yes The date to be formatted
type Yes The format type from one of the predefined date formats
mask No A string with the date mask to use

Example

// format the date using a supplied mask
Return FormatDate({Order.Orderdate},drCustomDateMask,"MMMM, d, yyyy")

Notes

  • When exp cannot be converted to a datetime, a runtime error is generated.
  • When type cannot be converted to an integer, a runtime error is generated.
  • When mask cannot be converted to a string, a runtime error is generated.