home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / lsdateformat.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  1.1 KB  |  38 lines

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