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!

Date/Time Formatting

Status
Not open for further replies.

scripter73

Programmer
Apr 18, 2001
421
US
Hi,

How do I manipulate a Cold Fusion function to return the current date/time in the following format: 08/02/2001 12:30:00 PM?

I'm trying to do something like:
<cfset entrydatetime = DateFormat(Now())>

but it is only returning 8/2/2001. I'd like the time/time of day attached.

Please advise.

Thanks in advance for your help.
scripter73
 
You have to do them separately, like this:
Code:
#DateFormat(ServiceCreated, &quot;mmm dd ,yyyy&quot;)#  #TimeFormat(ServiceCreated, &quot;hh:mm tt&quot;)#
Calista :-X
Jedi Knight,
Champion of the Force
 
Oops. That wasn't it. Try:

<cfset thisdate = DateFormat(Now())>
<cfset thistime = TimeFormat(Now())>

<cfoutput>
#thisdate# #thistime#
</cfoutput> John Hoarty
jhoarty@quickestore.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top