August 2003
Intermediate to advanced
1140 pages
68h 45m
English
LSTimeFormat
LSTimeFormat(time [, mask])Returns locale-specific time formatted
according to mask. If no value is
specified for mask, LSTimeFormat(
) uses the default locale’s format. Valid
entries for mask are the same as for
TimeFormat( ). If an invalid mask is passed to the
function, ColdFusion outputs the invalid characters. The following
example demonstrates for each locale:
<cfset TheTime = Now( )>
<cfloop index="locale" list="#Server.Coldfusion.SupportedLocales#">
<cfset SetLocale(locale)>
<cfoutput>
<p><b>#locale#</b><br>
TheTime = #LSTimeFormat(TheTime)#<br>
LSTimeFormat(TheTime, 'h:m:s'): #LSTimeFormat(TheTime, 'h:m:s')#<br>
LSTimeFormat(TheTime, 'h:m:s t'): #LSTimeFormat(TheTime, 'h:m:s t')#<br>
LSTimeFormat(TheTime, 'hh:mm:ss'): #LSTimeFormat(TheTime, 'hh:mm:ss')#<br>
LSTimeFormat(TheTime, 'hh:mm:ss tt'):
#LSTimeFormat(TheTime, 'hh:mm:ss tt')#<br>
LSTimeFormat(TheTime, 'H:M:ss'): #LSTimeFormat(TheTime, 'H:M:s')#<br>
LSTimeFormat(TheTime, 'HH:MM:ss'): #LSTimeFormat(TheTime, 'HH:MM:ss')#<br>
<p>
And these formats are new in ColdFusion MX:<br>
short: #LSTimeFormat(TheTime, 'short')#<br>
medium: #LSTimeFormat(TheTime, 'medium')#<br>
long: #LSTimeFormat(TheTime, 'long')#<br>
full: #LSTimeFormat(TheTime, 'full')#<br>
</cfoutput>
</cfloop>