Formats a date/time string according to the English (U.S.) locale convention. (To format a date/time string for other locales, use the LSParseDateTime function.)
An English (U.S.)-formatted date/time value.
Date and time functions, Display and formatting functions
ParseDateTime(date/time-string [, pop-conversion ] )
IsDate,
IsNumericDate,
SetLocale
Parameter | Description |
---|---|
date/time string |
A date/time string or a variable that contains one. A date/time object is in the range 100 AD-9999 AD. See "How ColdFusion processes two-digit year values". |
pop-conversion |
|
This function is similar to CreateDateTime
, but it takes a string instead of enumerated date/time values. These functions are provided primarily to increase the readability of code in compound expressions.
When passing a date/time value as a string, you must enclose it in quotation marks. Otherwise, it is interpreted as a number representation of a date/time object.
To calculate a difference between time zones, use the GetTimeZoneInfo function.
To set the default display format of date, time, number, and currency values, use the SetLocale function.
Note: This function does not accept POP dates.
<h3>ParseDateTime Example</h3> <cfif IsDefined("FORM.theTestValue")> <cfif IsDate(FORM.theTestValue)> <h3>The expression <cfoutput>#DE(FORM.theTestValue)#</cfoutput> is a valid date</h3> <p>The date, parsed for use as a date/time value: <cfoutput>#ParseDateTime(FORM.theTestValue)# </cfoutput>