<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>LSDATEFORMAT</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">LSDATEFORMAT</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>
Formats the date part of a date/time value in a locale-specific format. 
</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 formatted date/time value. If no mask is specified, the value is formatted according to the locale setting of the client computer.
</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
</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>LSDateFormat(date [, mask ])
</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>
LSParseDateTime, LSTimeFormat, DateFormat, SetLocale; "Handling data in ColdFusion&#160;MX" 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 return different formatting than in earlier releases. This function uses Java standard locale formatting rules on all platforms. </li>

<li>Added support for the following mask parameter options: short, medium, long, and full. </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 uses Java standard locale formatting rules on all platforms. 
</p>

<p>
When passing date/time value as a string, enclose it in quotation marks. Otherwise, it is interpreted as a number representation of a date/time object.
</p>

<p>
To calculate a difference between time zones, use the GetTimeZoneInfo function. 
</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">Example</span><pre>&lt;h3&gt;LSDateFormat Example&lt;/h3&gt;
&lt;p&gt;LSDateFormat formats the date part of a date/time value using the 
locale convention. 
&lt;!--- loop through a list of locales; 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;
      #LSDateFormat(Now(), &quot;mmm-dd-yyyy&quot;)#&lt;br&gt;
      #LSDateFormat(Now(), &quot;mmmm d, yyyy&quot;)#&lt;br&gt;
      #LSDateFormat(Now(), &quot;mm/dd/yyyy&quot;)#&lt;br&gt;
      #LSDateFormat(Now(), &quot;d-mmm-yyyy&quot;)#&lt;br&gt;
      #LSDateFormat(Now(), &quot;ddd, mmmm dd, yyyy&quot;)#&lt;br&gt;
      #LSDateFormat(Now(), &quot;d/m/yy&quot;)#&lt;br&gt;
      #LSDateFormat(Now())#&lt;br&gt;      
      &lt;hr noshade&gt;
   &lt;/cfoutput&gt;
&lt;/cfloop&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="DATE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DATE</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 date/time object, in the range 100 AD-9999 AD.</p>

  </td>
  </tr>
  </table>
</div>
<div id="MASK">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">MASK</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>Characters that show how ColdFusion displays the date:</p><ul>

<li>d: Day of month. Digits; no leading zero for single-digit days </li>

<li>dd: Day of month. Digits; leading zero for single-digit days</li>

<li>ddd: Day of week, abbreviation</li>

<li>dddd: Day of week. Full name</li>

<li>m: Month. Digits; no leading zero for single-digit months</li>

<li>mm: Month. Digits; leading zero for single-digit months</li>

<li>mmm: Month. abbreviation (if appropriate)</li>

<li>mmmm: Month. Full name</li>

<li>y: Year. Last two digits; no leading zero for years less than 10</li>

<li>yy: Year. Last two digits; leading zero for years less than 10</li>

<li>yyyy: Year. Four digits</li>

<li>gg: Period/era string. Not processed. Reserved for future use</li>
</ul>

<p>The following conform to Java locale-specific time encoding standards. Their exact formats depend on the locale:</p><ul>

<li>short: dd, mm, and yy separated by / marks</li>

<li>medium: text format using mmm, d, and yyyy</li>

<li>long: text format using mmmm, d, and yyyy</li>

<li>full: text format using dddd, mmmm, d, and yyyy</li>
</ul>

<p>The default value is medium</p>
<p>For more information on formats, see LSParseDateTime.</p>

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

  </body>
</html>
