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 / lsparsedatetime.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.4 KB  |  40 lines

  1. <!--- This shows LSParseDateTime --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>LSParseDateTime Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9. <H3>LSParseDateTime Example</H3>
  10.  
  11. <P>LSParseDateTime returns a locale-specific date/time
  12. object
  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.   <CFSET oldlocale = SetLocale(locale)>
  21.   <CFIF ListContainsNoCase(showLocales, locale) is not 0>
  22.     <CFOUTPUT><P><B><I>#locale#</I></B><BR>
  23.         <P>Locale-specific formats:
  24.         <BR>#LSDateFormat(Now(), "mmm-dd-yyyy")# #LSTimeFormat(Now())#<BR>
  25.         #LSDateFormat(Now(), "mmmm d, yyyy")# #LSTimeFormat(Now())#<BR>
  26.         #LSDateFormat(Now(), "mm/dd/yyyy")# #LSTimeFormat(Now())#<BR>
  27.         #LSDateFormat(Now(), "d-mmm-yyyy")# #LSTimeFormat(Now())#<BR>
  28.         #LSDateFormat(Now(), "ddd, mmmm dd, yyyy")# #LSTimeFormat(Now())#<BR>
  29.         #LSDateFormat(Now(), "d/m/yy")# #LSTimeFormat(Now())#<BR>
  30.         #LSDateFormat(Now())# #LSTimeFormat(Now())#<BR>
  31.         <P>Standard Date/Time: <BR>#LSParseDateTime("#LSDateFormat(Now())# #LSTimeFormat(Now())#")#<BR>    
  32.         <hr noshade>
  33.     </CFOUTPUT>
  34.   </CFIF>
  35. </CFLOOP>
  36.  
  37. </BODY>
  38. </HTML>       
  39.  
  40.