DateTimeformat()

Formats the date according to the Java SimpleDateFormat convention

Usage

STRING = DateTimeformat( date, mask )
Argument Summary
date date
mask Formats the date according to the Java SimpleDateFormat convention

Calling

Supports named-parameter calling allowing you to use the function like:

DateTimeformat(
   date=?, 
   mask=?
);

Supports passing parameters as a structure using ArgumentCollection:

DateTimeformat( ArgumentCollection={
   date : ?, 
   mask : ?
} );

Extra

The following masks are used for this particular function. Please note, some of these may differ from the standard OpenBD DateFormat() and TimeFormat() masks.

<cfscript>
dt = DateTimeFormat( now(), "yyyy-MM-dd HH:mm:ss" );
</cfscript>
Letter Date or Time Examples
G Era designator AD
y Year 1996 ; 96
M Month in year July ; Jul ; 07
w Week in year 27
W Week in month 2
D Day in year 189
d Day in month 10
F Day of week in month 2
E Day in week Tuesday ; Tue
a Am/pm marker PM
H Hour in day (0-23) 0
k Hour in day (1-24) 24
K Hour in am/pm (0-11) 0
h Hour in am/pm (1-12) 12
m Minute in hour 30
s Second in minute 55
S Millisecond 978
z Time zone Pacific Standard Time ; PST ; GMT-08:00
Z Time zone -0800