ColdFusion 9.0 Resources |
LSParseDateTimeDescriptionConverts a string that is a valid date/time representation in the current locale into a date/time object. CategoryDate and time functions, Display and formatting functions, International functions, String functions See alsoLSDateFormat, ParseDateTime, SetLocale, GetLocale; Locales in the Developing ColdFusion Applications HistoryColdFusion 8: Added the locale parameter. ColdFusion MX:
Parameters
UsageThis function can parse any date, time, or date/time combination that conforms to Java standard locale formatting rules for the current locale. The following table lists some of the date/time values you can pass to this function in the English (US) locale. You can also pass only the date or the time parts of these formats:
Valid dates are in the range 100 AD–9999 AD. Two-digit years in the range 00-29 are interpreted as being 2000-2029. Two-digit years in the range 30-99 are interpreted as being 1930-1999 This function corrects for differences between the current time zone and any time zone specified in the input parameter.
Example<h3>LSParseDateTime Example - returns a locale-specific date/time object</h3> <!--- loop through a list of locales and show date values for Now()---> <cfloop LIST = "#Server.Coldfusion.SupportedLocales#" index = "locale" delimiters = ","> <cfset oldlocale = SetLocale(locale)> <cfoutput><p><B><I>#locale#</I></B><br> <p>Locale-specific formats: <br>#LSDateFormat(Now(), "mmm-dd-yyyy")# #LSTimeFormat(Now())#<br> #LSDateFormat(Now(), "mmmm d, yyyy")# #LSTimeFormat(Now())#<br> #LSDateFormat(Now(), "mm/dd/yyyy")# #LSTimeFormat(Now())#<br> #LSDateFormat(Now(), "d-mmm-yyyy")# #LSTimeFormat(Now())#<br> #LSDateFormat(Now(), "ddd, mmmm dd, yyyy")# #LSTimeFormat(Now())#<br> #LSDateFormat(Now(), "d/m/yy")# #LSTimeFormat(Now())#<br> #LSDateFormat(Now())# #LSTimeFormat(Now())#<br> <p>Standard Date/Time: #LSParseDateTime("#LSDateFormat(Now())# #LSTimeFormat(Now())#")#<br> </cfoutput> </cfloop> |