Edit

Date Time Cheatsheet

Formatting

FormatNotes
dDay of the month as digits; no leading zero for single-digit days.
ddDay of the month as digits; leading zero for single-digit days.
EEEDay of the week as a three-letter abbreviation.
EEEEDay of the week as its full name.
mMonth as digits; no leading zero for single-digit months. CAUTION: In timeFormat() "m" means "minutes"
mmMonth as digits; leading zero for single-digit months.
mmmMonth as a three-letter abbreviation.
mmmmMonth as its full name.
MMonth in year.
DDay in year. (Depends on -Dcoldfusion.datemask.useDasdayofmonth after CF2021U1)
yyYear as last two digits; leading zero for years less than 10.
yyyyYear represented by four digits.
YWeek year
YYWeek year as last two digits; leading zero for years less than 10.
YYYYWeek year represented by four digits.
GPeriod/era string. (e.g. BC, AD)
hhours; no leading zero for single-digit hours (12-hour clock)
hhhours; leading zero for single-digit hours (12-hour clock)
Hhours; no leading zero for single-digit hours (24-hour clock)
HHhours; leading zero for single-digit hours (24-hour clock)
nminutes; no leading zero for single-digit minutes
nnminutes; a leading zero for single-digit minutes
sseconds; no leading zero for single-digit seconds
ssseconds; leading zero for single-digit seconds
l or Lmilliseconds, with no leading zeros
tone-character time marker string, such as A or P
ttmultiple-character time marker string, such as AM or PM
wWeek of the year as digit. (JDK7+)
wwWeek of the year as digits. Leading zero for single-digit week. (JDK7+)
WWeek of the month as digit. (JDK7+)
WWWeek of the month as digits. Leading zero for single-digit week. (JDK7+)

Shortcuts

ShortcutFormat
shortm/d/yy h:nn tt
mediummmm d, yyyy h:nn:ss tt
longmmmm dd, yyyy h:nn:ss tt UTC
fullEEEE, mmmm dd, yyyy h:nn:ss tt UTC
isoyyyy-mm-dd'T'HH:nn:ssX

Date functions

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub