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

LSDateFormat

Synopsis

                  
                  
                  LSDateFormat(date [, mask])

Returns a locale-specific date format according to mask. Dates must be in the range AD 100-9999. If no value is specified for mask, LSDateFormat( ) uses the locale-specific default. For valid mask entries, see the DateFormat( ) function. Dates passed as literals must be enclosed in quotes. Otherwise, ColdFusion interprets the date as a numeric date. If an invalid mask is passed to the function, ColdFusion outputs the invalid characters. For information on how ColdFusion MX handles two-digit years, see the entry for CreateDate( ). The following example applies the LSDateFormat( ) function to each locale:

<cfloop index="locale" list="#Server.Coldfusion.SupportedLocales#">
  <cfset SetLocale(locale)>
  <cfoutput>
    <p><b>#locale#</b><br>
    #LSDateFormat(Now( ))#<br> 
    #LSDateFormat(Now( ), "d/m/yy")#<br>
    #LSDateFormat(Now( ), "d-mmm-yyyy")#<br>
    #LSDateFormat(Now( ), 'dd mmm yy')#<br>
    #LSDateFormat(Now( ), 'dddd, mmmm dd, yyyy')#<br>
    #LSDateFormat(Now( ), "mm/dd/yyyy")#<br>
    #LSDateFormat(Now( ), "mmmm d, yyyy")#<br>
    #LSDateFormat(Now( ), "mmm-dd-yyyy")#<br>
    short: #LSDateFormat(Now( ), 'short')#<br>
    medium: #LSDateFormat(Now( ), 'medium')#<br>
    long: #LSDateFormat(Now( ), 'long')#<br>
    full: #LSDateFormat(Now( ), '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