Jon Clausen wrote:
> On Nov 12, 2006, at 11:57 AM, Bob Imperial wrote:
> 
>> 1.)In outputting my datetime here, how would I go about adding the  
>> AM/PM
>> designation for output?
>>
>>   <cfset myDate = now()>
>>   <cffile action="write"
>>      file="#BaseDir#\index.cfm"
>>      output="Website directories were created successfully on
>> #DateFormat(CreateODBCDate(myDate), "mmmm d, yyyy hh:mm:ss")#">
> 
> #DateFormat(createODBCDateTime(myDate), "mmmm dd, yyyy")# #TimeFormat 
> (createODBCDateTime(myDate),"hh:mm:ss tt")#
> 
> ("tt" does not work in the DateFormat() function )

FYI, there is absolutely no need to use createODBCDateTime() here

If "myDate" is already a date, then you can just pass IT to date format. 
  The only purpose of createODBCDateTime() is if you're putting a date 
time object in a query and you're *NOT* using CFQUERYPARAM.

so above, you'd be just fine with:

#DateFormat(myDate, "mmmm dd, yyyy")# #TimeFormat(myDate,"hh:mm:ss tt")#

Rick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260091
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to