home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / lsdateformat.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.1 KB  |  39 lines

  1. <!--- This shows LSDateFormat --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>LSDateFormat Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9. <H3>LSDateFormat Example</H3>
  10.  
  11. <P>LSDateFormat formats the date portion of a date/time
  12. value using the locale convention. 
  13.  
  14. <!--- Limit locale display --->
  15. <CFSET showLocales = "English (US),English (UK),French (Standard),French (Swiss),German (Standard),Italian (Standard)">
  16.  
  17. <!--- loop through a list of possible locales and
  18. show date values for Now() --->
  19. <CFLOOP LIST="#Server.Coldfusion.SupportedLocales#"
  20. INDEX="locale" DELIMITERS=",">
  21.   <CFIF ListContainsNoCase(showLocales, locale) is not 0>
  22.     <CFSET oldlocale = SetLocale(locale)>
  23.     <CFOUTPUT><P><B><I>#locale#</I></B><BR>
  24.         #LSDateFormat(Now(), "mmm-dd-yyyy")#<BR>
  25.         #LSDateFormat(Now(), "mmmm d, yyyy")#<BR>
  26.         #LSDateFormat(Now(), "mm/dd/yyyy")#<BR>
  27.         #LSDateFormat(Now(), "d-mmm-yyyy")#<BR>
  28.         #LSDateFormat(Now(), "ddd, mmmm dd, yyyy")#<BR>
  29.         #LSDateFormat(Now(), "d/m/yy")#<BR>
  30.         #LSDateFormat(Now())#<BR>        
  31.         <hr noshade>
  32.     </CFOUTPUT>
  33.   </CFIF>
  34. </CFLOOP>
  35.  
  36. </BODY>
  37. </HTML>       
  38.  
  39.