Skip to Main Content
Programming ColdFusion MX, 2nd Edition
book

Programming ColdFusion MX, 2nd Edition

by Rob Brooks-Bilson
August 2003
Intermediate to advanced content levelIntermediate to advanced
1140 pages
68h 45m
English
O'Reilly Media, Inc.
Content preview from Programming ColdFusion MX, 2nd Edition

Name

LSTimeFormat

Synopsis

                  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>
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming ColdFusion

Programming ColdFusion

Rob Brooks-Bilson

Publisher Resources

ISBN: 0596003803Supplemental ContentErrata Page