User Guide

600 Chapter 3: ColdFusion Functions
LSDateFormat
Description
Formats the date part of a date/time value in a locale-specific format.
Returns
A formatted date/time value. If no mask is specified, the value is formatted according to the locale
setting of the client computer.
Category
Date and time functions, Display and formatting functions, International functions
Function syntax
LSDateFormat(date [, mask ])
See also
LSParseDateTime, LSTimeFormat, DateFormat, SetLocale
History
ColdFusion MX:
Changed formatting behavior: this function might return different formatting than in earlier
releases. This function uses Java standard locale formatting rules on all platforms.
Added support for the following mask attribute options: short, medium, long, and full.
Parameters
Usage
This function uses Java standard locale formatting rules on all platforms.
Parameter Description
date A date/time object, in the range 100 AD–9999 AD.
mask Characters that show how ColdFusion displays the date:
d: Day of month. Digits; no leading zero for single-digit days
dd: Day of month. Digits; leading zero for single-digit days
ddd: Day of week, abbreviation
dddd: Day of week. Full name
m: Month. Digits; no leading zero for single-digit months
mm: Month. Digits; leading zero for single-digit months
mmm: Month. abbreviation (if appropriate)
mmmm: Month. Full name
y: Year. Last two digits; no leading zero for years less than 10
yy: Year. Last two digits; leading zero for years less than 10
yyyy: Year. Four digits
gg: Period/era string. Not processed. Reserved for future use
The following conform to Java locale-specific time encoding standards. Their exact
formats depend on the locale:
short: dd, mm, and yy separated by / marks
medium: text format using mmm, d, and yyyy
long: text format using mmmm, d, and yyyy
full: text format using dddd, mmmm, d, and yyyy
Default: medium
For more information on formats, see LSParseDateTime on page 615
.