DateTimeFormat
Hi, I looked at all the functions but can't seem to find a CF function that formats date and time in one shot. Can I change the output of Now() directly into this format : 2003-01-27 14:54:29 Or do I have to parse out the date and time and do it separately? Looking for a shortcut:) Thanks ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: DateTimeFormat
You'll need to do #DateFormat(var)# #TimeFormat(var)#, but you can use the same variable - the functions are smart enough to extract the date and time info accordingly. At 04:09 PM 1/27/2003 -0500, you wrote: >Or do I have to parse out the date and time and do it separately? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: DateTimeFormat
Not in one shot but you can do something like: -- Sam -Original Message- From: Frank Mamone [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 1:10 PM To: CF-Talk Subject: DateTimeFormat Hi, I looked at all the functions but can't seem to find a CF function that formats date and time in one shot. Can I change the output of Now() directly into this format : 2003-01-27 14:54:29 Or do I have to parse out the date and time and do it separately? Looking for a shortcut:) Thanks ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: DateTimeFormat
You could write a function to return the correct string in one shot function date_time(tmpVar){ New_DateTime= DateFormat(tmpVar, "-mm-dd") & " " & TimeFormat(tmpVar, "hh:mm:ss"); return New_DateTime; }; -Original Message- From: Sam Roach [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 4:17 PM To: CF-Talk Subject: RE: DateTimeFormat Not in one shot but you can do something like: -- Sam -Original Message- From: Frank Mamone [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 1:10 PM To: CF-Talk Subject: DateTimeFormat Hi, I looked at all the functions but can't seem to find a CF function that formats date and time in one shot. Can I change the output of Now() directly into this format : 2003-01-27 14:54:29 Or do I have to parse out the date and time and do it separately? Looking for a shortcut:) Thanks ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: DateTimeFormat
unfortunately CF 4.5 thanks. - Original Message - From: <"Roberson>; ; > To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, January 27, 2003 4:23 PM Subject: RE: DateTimeFormat > You could write a function to return the correct string in one shot > > function date_time(tmpVar){ > > New_DateTime= DateFormat(tmpVar, "-mm-dd") & " " & > TimeFormat(tmpVar, "hh:mm:ss"); > > return New_DateTime; > }; > > -Original Message- > From: Sam Roach [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 27, 2003 4:17 PM > To: CF-Talk > Subject: RE: DateTimeFormat > > > Not in one shot but you can do something like: > #TimeFormat("#Now()#", "hh:mm:ss")#> > > -- Sam > > > -Original Message- > From: Frank Mamone [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 27, 2003 1:10 PM > To: CF-Talk > Subject: DateTimeFormat > > > Hi, > > I looked at all the functions but can't seem to find a CF function that > formats date and time in one shot. > > Can I change the output of Now() directly into this format : 2003-01-27 > 14:54:29 > > Or do I have to parse out the date and time and do it separately? > > Looking for a shortcut:) > > Thanks > > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4