dateFormat

Formats a date value using U.S. date formats. When formatting both date and time, use DateTimeFormat. For international date support, use LSDateFormat.
[mask - quicky]
d,dd,ddd,dddd: Day of month / week
m,mm,mmm,mmmm: Month
y,yy,yyyy: Year
gg: Period/era string
short / medium / long / full

dateFormat(date [, mask]) → returns String

Member Function Syntax

date.dateFormat([mask])

Argument Reference for the dateFormat function

date

Required: Yes
Values:
  • now()

mask

Required: No
Values:
  • short
  • medium
  • long
  • full

Compatibility

ColdFusion:

CF 6+ Added support for the short, medium, long and full mask formats. Member function is available in CF 11+.

Lucee:

Member function is available in Lucee 4.5+.

Links more information about dateFormat

Examples sample code invoking the dateFormat function


Using the short mask

dateFormat("2015-04-11", "short")

Expected Result: 4/11/15


Using the long mask

dateFormat("2015-04-11", "long")

Expected Result: April 11, 2015


Using the full mask

dateFormat("2015-04-11", "full")

Expected Result: Saturday, April 11, 2015


Fork me on GitHub