Formats the date part of a date/time value in a locale-specific format.
[mask - quicky]
d,dd,ddd,dddd: Day of month / week
m,mm,mmm,mmmm: Month
y,yy,yyyy: Year
gg: Period/era string
short / medium / long / full
lsDateFormat(date [, mask, locale])
→ returns string
date.lsDateFormat([mask, locale])
medium
short
medium
long
full
lsDateFormat formats the date part of a date/time value using the locale convention.
<!--- loop through a list of locales; show date values for now()--->
<cfloop list = "#Server.Coldfusion.SupportedLocales#"
index = "locale" delimiters = ",">
<cfset oldlocale = setLocale(locale)>
<cfoutput><p><B><I>#locale#</I></B>
#lsDateFormat(now(), "mmm-dd-yyyy")#
#lsDateFormat(now(), "mmmm d, yyyy")#
#lsDateFormat(now(), "mm/dd/yyyy")#
#lsDateFormat(now(), "d-mmm-yyyy")#
#lsDateFormat(now(), "ddd, mmmm dd, yyyy")#
#lsDateFormat(now(), "d/m/yy")#
#lsDateFormat(now())#
<hr noshade>
</cfoutput>
</cfloop>
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.