556
Chapter 3: ColdFusion Functions
DateFormat
Description
Formats a date value using U.S. date formats. For international date support, use
LSDateFormat
.
Returns
A text string representing the date formatted according to the mask. If no mask is specified,
returns the value in
dd-mmm-yy
format.
Category
Date and time functions
Function syntax
DateFormat
("
date"
[, "
mask"
])
See also
Now
,
CreateDate
,
LSDateFormat
,
LSParseDateTime
,
LSTimeFormat
,
TimeFormat
,
ParseDateTime
History
ColdFusion MX: Added support for the following
mask
parameter options:
short
,
medium
,
long
,
and
full
.
Parameters
Parameter
Description
date
Date/time object, in the range 100 AD–9999 AD.
mask
Characters that show how ColdFusion displays a date:
•
d: Day of the month as digits; no leading zero for single-digit days.
•
dd: Day of the month as digits; leading zero for single-digit days.
•
ddd: Day of the week as a three-letter abbreviation.
•
dddd: Day of the week as its full name.
•
m: Month as digits; no leading zero for single-digit months.
•
mm: Month as digits; leading zero for single-digit months.
•
mmm: Month as a three-letter abbreviation.
•
mmmm: Month as its full name.
•
yy: Year as last two digits; leading zero for years less than 10.
•
yyyy: Year represented by four digits.
•
gg: Period/era string. Ignored. Reserved.
The following masks tell how to format the full date and cannot be combined with
other masks:
•
short: equivalent to m/d/y
•
medium: equivalent to mmm d, yyyy
•
long: equivalent to mmmm d, yyyy
•
full: equivalent to dddd, mmmm d, yyyy
Summary of Contents for COLFUSION MX 7-CFML
Page 1: ...COLDFUSION MX7 CFML Reference...
Page 20: ...20 Chapter 1 Reserved Words and Variables...
Page 50: ...50 Chapter 2 ColdFusion Tags cfelse br Searching cfif cfloop cfif...
Page 101: ...cfdefaultcase 101 cfdefaultcase cfswitch cfoutput Your grade is grade cfoutput...
Page 115: ...cfdocumentsection 115 cfdocumentsection cfoutput cfdocument...
Page 411: ...cftable 411 cftable body html...
Page 515: ...Chr 515 maxlength 5 p input type Submit name input type RESET cfform...
Page 605: ...GetEncoding 605 WriteOutput The encoding is theEncoding cfscript cfif...
Page 629: ...GetProfileString 629 tr td input type Submit name Submit value Submit td td td tr table form...
Page 655: ...IIf 655 cfoutput IIf Hour Now GTE 12 DE It is afternoon or evening DE It is morning cfoutput b...
Page 664: ...664 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Page 687: ...IsStruct 687 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 751: ...LSDateFormat 751 hr noshade cfoutput cfloop...
Page 861: ...StructFind 861 cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 903: ...Val 903 value Is the beginning numeric name form...
Page 932: ...932 Chapter 3 ColdFusion Functions...
Page 944: ...944 Chapter 4 ColdFusion MX Flash Form Style Reference...
Page 962: ...962 Chapter 5 Application CFC Reference...
Page 1054: ...1054 Chapter 6 ColdFusion MX Event Gateway Reference...