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

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