How can i format a date?
By using the DateFormat() function, we can tell ColdFusion that we want to see a date:
<cfoutput>#DateFormat(Now())#</cfoutput>
returns 24-Jun-02
Continuing onward, we can customize the date format even more by specifying a mask in the DateFormat() function.
<cfoutput>#DateFormat(Now(),"mm/dd/yy")#</cfoutput>
returns 06/24/02
<cfoutput>#DateFormat(Now(),"ddd, mmm d, yyyy")#</cfoutput>
returns Thu, Jun 24, 2002
<cfoutput>#DateFormat(Now(),"dddd, mmmm d, yyyy")#</cfoutput>
returns Thursday, June 24, 2002
<cfset setLocale("Dutch (Standard)")>
<cfoutput>#DateFormat(Now(),"dddd, mmmm d, yyyy")#</cfoutput>
returns Dinsdag, Juni 24, 2002
4155 viewed | Your opinion... | del.icio.us | Digg it | Tjarko @ 14/11/02 9:46 cet



