Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying time in 12 hour format 1

Status
Not open for further replies.

mako

Programmer
Apr 6, 2000
11
MY
hi! i could use some help here. how do you display time in 12 hour format (with AM and PM) in coldfusion?
 
&lt;CFSET todayDate=#Now()#&gt;<br>&lt;CFOUTPUT&gt;#todayDate#&lt;/CFOUTPUT&gt;<br>&lt;P&gt;<br>&lt;CFOUTPUT&gt;<br>&lt;UL&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;LI&gt;#TimeFormat(todayDate)#<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;LI&gt;#TimeFormat(todayDate, &quot;hh:mm:ss&quot;)#<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;LI&gt;#TimeFormat(todayDate, &quot;hh:mm:sst&quot;)#<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;LI&gt;#TimeFormat(todayDate, &quot;hh:mm:sstt&quot;)#<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;LI&gt;#TimeFormat(todayDate, &quot;HH:mm:ss&quot;)#<br>&lt;/UL&gt;<br>&lt;/CFOUTPUT&gt;<br><br>result is something like this:<br>{ts '2000-04-29 18:44:39'}<br><br>06:44 PM <br>06:44:39 <br>06:44:39P <br>06:44:39PM <br>18:44:39 <br><br>Check the cfdocs<br>Webron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top