Formats the time part of a date/time string into a string in a locale-specific format.
[mask - quicky]
h,hh,H,HH: Hours; m,mm: Minutes; s,ss: Seconds;
l: Milliseconds; t: A or P; tt: AM or PM
"short" = h:mm tt; "medium" = h:mm:ss tt
lsTimeFormat(time [, mask, locale])
→ returns string
time.lsTimeFormat([mask])
short
short
medium
long
en
de_DE
de_CH
...
lsTimeFormat returns a time value using the locale convention.
<!--- loop through a list of locales and show time values --->
<cfloop LIST = "#Server.Coldfusion.SupportedLocales#"
index = "locale" delimiters = ",">
<cfset oldlocale = setLocale(locale)>
<cfoutput><p><B><I>#locale#</I></B>
#lsTimeFormat(now())#
#lsTimeFormat(now(), 'hh:mm:ss')#
#lsTimeFormat(now(), 'hh:mm:sst')#
#lsTimeFormat(now(), 'hh:mm:sstt')#
#lsTimeFormat(now(), 'HH:mm:ss')#
<hr noshade>
</cfoutput>
</cfloop>
lsTimeFormat returns a time value using the specified locale.
writeDump(lsTimeFormat(now(), 'short', 'en_US'));
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.