User Guide
616 Chapter 3: ColdFusion Functions
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.
• If a time zone specified in the date/time-string parameter is different from the time zone
setting of the computer, ColdFusion adjusts the time value to its equivalent in the computer
time zone.
• If a time zone is not specified in the date/time-string parameter, ColdFusion does not
adjust the time value.
Note: This function does not accept POP dates, which include a time zone offset value.
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>