<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>LSTIMEFORMAT</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">LSTIMEFORMAT</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 time part of a date/time string into a string 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 string representing the time value.
</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>LSTimeFormat(time [, 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, LSDateFormat, TimeFormat; "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 MX&#160;6.1: Added the mask character L or l to represent milliseconds.
</p>

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

<p>
To set the default display format of date, time, number, and currency values, use the SetLocale function. 
</p>

<p>
If no seconds value is passed to this function, and the mask value is s, the default output seconds format is one zero; for example, lstimeformat(6:39, &quot;h:m:s&quot;) returns 6:39:0. If the mask value is ss, it returns 6:39:00.
</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;LSTimeFormat Example&lt;/h3&gt;

&lt;p&gt;LSTimeFormat returns a time value using the locale convention. 

&lt;!--- loop through a list of locales and show time values ---&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;
   #LSTimeFormat(Now())#&lt;br&gt;
   #LSTimeFormat(Now(), `hh:mm:ss')#&lt;br&gt;   
   #LSTimeFormat(Now(), `hh:mm:sst')#&lt;br&gt;   
   #LSTimeFormat(Now(), `hh:mm:sstt')#&lt;br&gt;   
   #LSTimeFormat(Now(), `HH:mm:ss')#&lt;br&gt;   
      &lt;hr noshade&gt;
   &lt;/cfoutput&gt;

&lt;/cfloop&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="STRING">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">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>

<ul>

<li>A date/time value </li>

<li>A string that is convertible to a time value</li>
</ul>

<p>A date/time object is 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>Masking characters that determine the format:</p><ul>

<li>h: Hours; no leading zero for single-digit hours (12-hour clock)</li>

<li>hh: Hours; leading zero for single-digit hours. (12-hour clock)</li>

<li>H: Hours; no leading zero for single-digit hours (24-hour clock)</li>

<li>HH: Hours; leading zero for single-digit hours (24-hour clock)</li>

<li>m: Minutes; no leading zero for single-digit minutes</li>

<li>mm: Minutes; leading zero for single-digit minutes</li>

<li>s: Seconds; no leading zero for single-digit seconds </li>

<li>ss: Seconds; leading zero for single-digit seconds </li>

<li>l: Milliseconds</li>

<li>t: One-character time marker string, such as A or P. </li>

<li>tt: Multiple-character time marker string, such as AM or PM</li>
</ul>

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

<li>short: includes hours, minutes; may include AM or PM</li>

<li>medium: includes hours, minutes; may include AM or PM</li>

<li>long: medium plus time zone</li>

<li>full: long, may also include an hour designator</li>
</ul>

<p>The default value is short.</p>

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

  </body>
</html>
