A locale-specific version of the ParseDateTime
function, except that there is no option for POP date/time object parsing. Returns a date/time object.
LSParseDateTime(date/time-string)
When passing a date/time value for the English (US) locale, the date/time string can be in any of the following forms:
If you specify a year in the date, specify the full year.
If the date is formatted for a locale other than the English (US) locale, add or subtract the conversion time.
Year values 0 - 29 are interpreted as 21st century dates. Year values 30 - 99 are interpreted as 20th century dates.
Note
|
<!--- This shows LSParseDateTime ---> <html> <head> <title>LSParseDateTime Example</title> </head> <body> <H3>LSParseDateTime Example</H3> <P>LSParseDateTime returns a locale-specific date/time object. <!--- 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> <Hr noshade> </cfoutput> </CFLOOP> </body> </html>