• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

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>

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint