<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>LSPARSEDATETIME</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">LSPARSEDATETIME</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Converts a string that is a valid date/time representation in the current locale into a date/time object.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
A date/time object.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Date and time functions, Display and formatting functions, International functions, String functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>LSParseDateTime(date/time-string)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
LSDateFormat, ParseDateTime, SetLocale, GetLocale; "Locales" in Chapter&#160;17, "Developing Globalized Applications," in ColdFusion MX Developer's Guide
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">History</span>
<p>
ColdFusion&#160;MX: 
</p>
<ul>

<li>Changed formatting behavior: this function might not parse string formats that worked with earlier releases. This function uses Java standard locale formatting rules on all platforms. </li>

<li>Changed how the date/time-string parameter value is processed: ColdFusion processes the date/time-string parameter value time zone information differently than in earlier releases, as described in the Usage section.</li>
</ul>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
This function can parse any date, time, or date/time combination that conforms to Java standard locale formatting rules for the current locale.
</p>

<p>
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: 
</p>

<p>
</p><div align="left">
<table border="1">
  <caption></caption>
  <tr align="center">    <th>&#160;</th>
    <th>&#160;</th>
</tr>
  <tr align="left">    <td>
<p>m/dd/yy h:mm:ss</p></td>
    <td>
<p>1/30/02 7:02:33</p></td>
</tr>
  <tr align="left">    <td>
<p>m/dd/yy h:mm tt</p></td>
    <td>
<p>1/30/02 7:02 AM </p></td>
</tr>
  <tr align="left">    <td>
<p>m/dd/yyyy h:mm</p></td>
    <td>
<p>1/30/2002 7:02 AM </p></td>
</tr>
  <tr align="left">    <td>
<p>mmm dd, yyyy h:mm:ss tt</p></td>
    <td>
<p>Jan 30, 2002 7:02:12 AM </p></td>
</tr>
  <tr align="left">    <td>
<p>mmmm dd, yyyy h:mm:ss tt zzz </p></td>
    <td>
<p>January 30, 2002 7:02:23 AM PST </p></td>
</tr>
  <tr align="left">    <td>
<p>ddd, mmm dd, yyyy hh:mm:ss </p></td>
    <td>
<p>Wed, Jan 30, 2002 07:02:12 </p></td>
</tr>
  <tr align="left">    <td>
<p>dddd, mmmm dd, yyyy h:mm:ss tt zzz </p></td>
    <td>
<p>Wednesday, January 30, 2002 7:02:12 AM PST </p></td>
</tr>
</table>
</div>
<p>
</p>

<p>
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
</p>

<p>
This function corrects for differences between the current time zone and any time zone specified in the input parameter. 
</p>
<ul>

<li>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.</li>

<li>If a time zone is not specified in the date/time-string parameter, ColdFusion does not adjust the time value. </li>
</ul>
<table>
  <tr valign="top">
    <td width="30"><strong>Note: </strong></td>
    <td>This function does not accept POP dates, which include a time zone offset value.</td>
  </tr>
</table>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;h3&gt;LSParseDateTime Example - returns a locale-specific date/time object&lt;/h3&gt;
&lt;!--- loop through a list of locales and show date values for Now()---&gt;
&lt;cfloop LIST = &quot;#Server.Coldfusion.SupportedLocales#&quot;
index = &quot;locale&quot; delimiters = &quot;,&quot;&gt;
   &lt;cfset oldlocale = SetLocale(locale)&gt;
   &lt;cfoutput&gt;&lt;p&gt;&lt;B&gt;&lt;I&gt;#locale#&lt;/I&gt;&lt;/B&gt;&lt;br&gt;
      &lt;p&gt;Locale-specific formats:
      &lt;br&gt;#LSDateFormat(Now(), &quot;mmm-dd-yyyy&quot;)# #LSTimeFormat(Now())#&lt;br&gt;
      #LSDateFormat(Now(), &quot;mmmm d, yyyy&quot;)# #LSTimeFormat(Now())#&lt;br&gt;
      #LSDateFormat(Now(), &quot;mm/dd/yyyy&quot;)# #LSTimeFormat(Now())#&lt;br&gt;
      #LSDateFormat(Now(), &quot;d-mmm-yyyy&quot;)# #LSTimeFormat(Now())#&lt;br&gt;
      #LSDateFormat(Now(), &quot;ddd, mmmm dd, yyyy&quot;)# #LSTimeFormat(Now())#&lt;br&gt;
      #LSDateFormat(Now(), &quot;d/m/yy&quot;)# #LSTimeFormat(Now())#&lt;br&gt;
      #LSDateFormat(Now())# #LSTimeFormat(Now())#&lt;br&gt;
   &lt;p&gt;Standard Date/Time:
   #LSParseDateTime(&quot;#LSDateFormat(Now())# #LSTimeFormat(Now())#&quot;)#&lt;br&gt;
   &lt;/cfoutput&gt;
&lt;/cfloop&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="DATE/TIME-STRING">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DATE/TIME-STRING</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>A string a variable that contains one, in a format that is readable in the current locale. </p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
