Date Function ???
This should simple for a lot of you. What data function do I use to create a countdown for the number of DAYS left until January 1, 2007? Thanks. D ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244464 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Date Function ???
DateDiff(d, Now(), CreateDate(2007, 1, 1)) -- Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244468 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Date Function ???
#DateDiff(d, Now(), 01/01/2007)# -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 21, 2006 3:37 PM To: CF-Talk Subject: Date Function ??? This should simple for a lot of you. What data function do I use to create a countdown for the number of DAYS left until January 1, 2007? Thanks. D ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244469 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Date Function ???
dateDiff()? http://livedocs.macromedia.com/coldfusion/7/htmldocs/0440.htm cfoutput#dateDiff('d', now(), createDate(2007, 1, 1))#/cfoutput On 6/21/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This should simple for a lot of you. What data function do I use to create a countdown for the number of DAYS left until January 1, 2007? Thanks. D ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244470 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Date Function ???
Actually, you can also do an inline calculation (for days, wont work for weeks or months): #CreateDate(2007,1,1)-Now()# Or cfset daysToNewYear=CreateDate(2007,1,1)-Now() That will return partial day values, too, so you may want to use: #Int(CreateDate(2007,1,1)-Now())# --- Ben -Original Message- From: Ben Forta [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 21, 2006 3:42 PM To: CF-Talk Subject: RE: Date Function ??? #DateDiff(d, Now(), 01/01/2007)# -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 21, 2006 3:37 PM To: CF-Talk Subject: Date Function ??? This should simple for a lot of you. What data function do I use to create a countdown for the number of DAYS left until January 1, 2007? Thanks. D ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244473 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Simple Date Function Question...at least I think it is.
What would be the easiest way to write code to determine whether the current week of the year is even or odd? I am looking to display two different groups of images, each group being displayed every other week. Thanks, Che [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Simple Date Function Question...at least I think it is.
Try something like this: cfif week(now()) MOD 2 WEEK IS EVEN cfelse WEEK IS ODD /cfif Matt On Thu, 26 Aug 2004 16:48:44 -0400, Che Vilnonis [EMAIL PROTECTED] wrote: What would be the easiest way to write code to determine whether the current week of the year is even or odd? I am looking to display two different groups of images, each group being displayed every other week. Thanks, Che [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Simple Date Function Question...at least I think it is.
Not a big deal, but that should actually be: cfif week(now()) MOD 2 WEEK IS ODD cfelse WEEK IS EVEN /cfif (if the remainder is 0, it is an even number. If it has a remainder, than it is odd) Matt On Thu, 26 Aug 2004 16:52:55 -0400, Matthew Fusfield [EMAIL PROTECTED] wrote: Try something like this: cfif week(now()) MOD 2 WEEK IS EVEN cfelse WEEK IS ODD /cfif Matt On Thu, 26 Aug 2004 16:48:44 -0400, Che Vilnonis [EMAIL PROTECTED] wrote: What would be the easiest way to write code to determine whether the current week of the year is even or odd? I am looking to display two different groups of images, each group being displayed every other week. Thanks, Che [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: Simple Date Function Question...at least I think it is.
interesting...if i had only remebered that there was a Week() function. i knew there had to be a simple answer. thanks Matt. -Original Message- From: Matthew Fusfield [mailto:[EMAIL PROTECTED] Sent: Thursday, August 26, 2004 4:53 PM To: CF-Talk Subject: Re: Simple Date Function Question...at least I think it is. Try something like this: cfif week(now()) MOD 2 WEEK IS EVEN cfelse WEEK IS ODD /cfif Matt On Thu, 26 Aug 2004 16:48:44 -0400, Che Vilnonis [EMAIL PROTECTED] wrote: What would be the easiest way to write code to determine whether the current week of the year is even or odd? I am looking to display two different groups of images, each group being displayed every other week. Thanks, Che [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: Simple Date Function Question...at least I think it is.
cfoutput cfif week(now()) MOD 2 GT 0 #week(now())# - Odd cfelse #week(now())# - Even /cfif /cfoutput -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Thursday, August 26, 2004 4:49 PM To: CF-Talk Subject: Simple Date Function Question...at least I think it is. What would be the easiest way to write code to determine whether the current week of the year is even or odd? I am looking to display two different groups of images, each group being displayed every other week. Thanks, Che [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Simple Date Function Question...at least I think it is.
cfif week(now()) MOD 2 is 0 WEEK IS EVEN cfelse WEEK IS ODD /cfif - Original Message - From: Matthew Fusfield To: CF-Talk Sent: Thursday, August 26, 2004 4:54 PM Subject: Re: Simple Date Function Question...at least I think it is. Not a big deal, but that should actually be: cfif week(now()) MOD 2 WEEK IS ODD cfelse WEEK IS EVEN /cfif (if the remainder is 0, it is an even number. If it has a remainder, than it is odd) Matt On Thu, 26 Aug 2004 16:52:55 -0400, Matthew Fusfield [EMAIL PROTECTED] wrote: Try something like this: cfif week(now()) MOD 2 WEEK IS EVEN cfelse WEEK IS ODD /cfif Matt On Thu, 26 Aug 2004 16:48:44 -0400, Che Vilnonis [EMAIL PROTECTED] wrote: What would be the easiest way to write code to determine whether the current week of the year is even or odd? I am looking to display two different groups of images, each group being displayed every other week. Thanks, Che [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: date function help for calendar
On Friday 16 Jan 2004 16:29 pm, Smith, Matthew P -CONT(CSC) wrote: view to default to the current week.So using the now() function, I need to find the, say, Sunday before and the Saturday after the current day. If dayToday is not dayToLookFor while dayToday is not dayTolookfor( add one day to dateToday dayToday = dayofweek(dateToday) wend return dateToday else return dateToday fi -- Tom Chiverton Advanced ColdFusion Programmer Tel: +44(0)1749 834997 email: [EMAIL PROTECTED] BlueFinger Limited Underwood Business Park Wookey Hole Road, WELLS. BA5 1AF Tel: +44 (0)1749 834900 Fax: +44 (0)1749 834901 web: www.bluefinger.com Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple Quay, BRISTOL. BS1 6EG. *** This E-mail contains confidential information for the addressee only. If you are not the intended recipient, please notify us immediately. You should not use, disclose, distribute or copy this communication if received in error. No binding contract will result from this e-mail until such time as a written document is signed on behalf of the company. BlueFinger Limited cannot accept responsibility for the completeness or accuracy of this message as it has been transmitted over public networks.*** [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
date function help for calendar
I'm doing a scheduler app for our intranet. I have a little problem, nothing major, but I thought I would shoot it out here before I get all jiggy with the date functions.Basically, I want the view to default to the current week.So using the now() function, I need to find the, say, Sunday before and the Saturday after the current day.For instance, for today, I would like the 11th and the 17th returned so I can use that as my interval.I'm sure it can get tricky what with end/beginnings of months and the like, so I was hoping someone might now of some good udfs or native cf functions that might work for this. I know I'll have to play with the code a bit and I'm not asking for a total solution, just some guidance in the direction I need to head.Though some snippets would rock.:P Thanks for any help, Matthew [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: date function help for calendar
This will give you the Sunday before and the Saturday after the current day. firstday = dateAdd(d,-(dayOfWeek(now()-1),now()) lastday = dateAdd(d,7-(dayOfWeek(now(),now()) HTH It's a bit more complicated if you want your week not to be Sunday through Saturday. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA -Original Message- From: Smith, Matthew P -CONT(CSC) [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:30 AM To: CF-Talk Subject: date function help for calendar I'm doing a scheduler app for our intranet. I have a little problem, nothing major, but I thought I would shoot it out here before I get all jiggy with the date functions.Basically, I want the view to default to the current week.So using the now() function, I need to find the, say, Sunday before and the Saturday after the current day.For instance, for today, I would like the 11th and the 17th returned so I can use that as my interval.I'm sure it can get tricky what with end/beginnings of months and the like, so I was hoping someone might now of some good udfs or native cf functions that might work for this. I know I'll have to play with the code a bit and I'm not asking for a total solution, just some guidance in the direction I need to head.Though some snippets would rock.:P Thanks for any help, Matthew _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Date function
Hi there. I am trying to find out what this month minus one is. I used DateFormat(Now()-30, ) and it works ok, but I worry that on certain days it wont work. Is there a way to subtract a month from Now() instead of subtracting days? TIA (I love this list by the way) Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ 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 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date function
DateAdd(m, -1, Now()) __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date function
dateadd(m, -1, now()) Robert Everland III Web Developer Extraordinaire Dixon Ticonderoga Company http://www.dixonusa.com -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 6:43 PM To: CF-Talk Subject: Date function Hi there. I am trying to find out what this month minus one is. I used DateFormat(Now()-30, ) and it works ok, but I worry that on certain days it wont work. Is there a way to subtract a month from Now() instead of subtracting days? TIA (I love this list by the way) Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ 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 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Date function
#Dateformat(DateAdd('m', -1, Now()), 'mm/dd/')# [EMAIL PROTECTED] 09/03/02 06:42PM Hi there. I am trying to find out what this month minus one is. I used DateFormat(Now()-30, ) and it works ok, but I worry that on certain days it wont work. Is there a way to subtract a month from Now() instead of subtracting days? TIA (I love this list by the way) Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Date function
dateformat(dateadd(m,-1,now()), ) Jerry Johnson [EMAIL PROTECTED] 09/03/02 06:42PM Hi there. I am trying to find out what this month minus one is. I used DateFormat(Now()-30, ) and it works ok, but I worry that on certain days it wont work. Is there a way to subtract a month from Now() instead of subtracting days? TIA (I love this list by the way) Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date function
If you look at the sniped error message, the problem is in the CF side not the SQL side. Try taking out the LSParseDateTime() -- it's getting confused by what is not the locale-specific format of the date. Since you want to put this thing in an nvarchar field, I would probably replace the entire statement with a DateFormat(date, format) where 'format' is the way I wanted the date to look in the DB. Buyer beware: this advice may very well be worth what you paid for it. --Ben Doom Programmer General Lackey Moonbow Software : -Original Message- : From: Matthew Walker [mailto:[EMAIL PROTECTED]] : Sent: Monday, July 29, 2002 1:04 AM : To: CF-Talk : Subject: RE: Date function : : : You should have the field type in the database as datetime. That might : fix it. : : If not then it's because LSParseDateTime() works on human dates, so you : could bypass it if it fails LSIsDate() maybe? : : : -Original Message- : From: NZERN National Office [mailto:[EMAIL PROTECTED]] : Sent: Monday, 29 July 2002 3:51 p.m. : To: CF-Talk : Subject: Date function : : : The function : : ArticleDate = CreateODBCDate(LSParseDateTime(ArticleDate)) : : is working well processing a form field with dates. : : However when I try an CFinsert to move this date from one : table to another : the following error message comes. : : the field type is nvarchar : : the ISP has SQL 7.0 with CFserver 5.0 : : thanks in advance for any clues : : Mike Peters : : : NZERN National Office : Mail: PO Box 9000, Christchurch : (03) 338-5451 : E-mail: [EMAIL PROTECTED] : http://www.bush.org.nz : : : snip-- : -- : --- : : An error occurred while evaluating the expression: : : : ArticleDate = CreateODBCDate(LSParseDateTime(ArticleDate)) : : : : Error near line 42, column 8. : -- : -- : : : Parameter 1 of function LSParseDateTime which is now {d : '2002-07-16'} must : be interpretable as a valid date/time value in the current locale : : snip-- : -- : - : : : : : __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Date function
The function ArticleDate = CreateODBCDate(LSParseDateTime(ArticleDate)) is working well processing a form field with dates. However when I try an CFinsert to move this date from one table to another the following error message comes. the field type is nvarchar the ISP has SQL 7.0 with CFserver 5.0 thanks in advance for any clues Mike Peters NZERN National Office Mail: PO Box 9000, Christchurch (03) 338-5451 E-mail: [EMAIL PROTECTED] http://www.bush.org.nz snip --- An error occurred while evaluating the expression: ArticleDate = CreateODBCDate(LSParseDateTime(ArticleDate)) Error near line 42, column 8. Parameter 1 of function LSParseDateTime which is now {d '2002-07-16'} must be interpretable as a valid date/time value in the current locale snip - __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date function
You should have the field type in the database as datetime. That might fix it. If not then it's because LSParseDateTime() works on human dates, so you could bypass it if it fails LSIsDate() maybe? -Original Message- From: NZERN National Office [mailto:[EMAIL PROTECTED]] Sent: Monday, 29 July 2002 3:51 p.m. To: CF-Talk Subject: Date function The function ArticleDate = CreateODBCDate(LSParseDateTime(ArticleDate)) is working well processing a form field with dates. However when I try an CFinsert to move this date from one table to another the following error message comes. the field type is nvarchar the ISP has SQL 7.0 with CFserver 5.0 thanks in advance for any clues Mike Peters NZERN National Office Mail: PO Box 9000, Christchurch (03) 338-5451 E-mail: [EMAIL PROTECTED] http://www.bush.org.nz snip-- -- --- An error occurred while evaluating the expression: ArticleDate = CreateODBCDate(LSParseDateTime(ArticleDate)) Error near line 42, column 8. -- -- Parameter 1 of function LSParseDateTime which is now {d '2002-07-16'} must be interpretable as a valid date/time value in the current locale snip-- -- - __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Date Function
Hello All, Here is a good one I have been thinking about this for a while and I can not figure it out! I am doing a schedule thing and I need to see if let's say at the time it goes, if we are the 1st of the month to get yesterday's date So I cab take that and format it with dateformat Does anyone know how this would be accomplished? Thanks, Joel __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://wwwpennyhostcom/redirectcfm?adcode=coldfusionc FAQ: http://wwwthenetprofitscouk/coldfusion/faq Archives: http://wwwmail-archivecom/cf-talk@houseoffusioncom/ Unsubscribe: http://wwwhouseoffusioncom/indexcfm?sidebar=lists
RE: Date Function
I'm sorry, I'm not sure what you are asking. Are you asking how to get the previous day's date? Kathryn Butterly Web Developer Washington Mutual Finance 813 632-4490 [EMAIL PROTECTED] -Original Message- From: Joel Blanchette [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 3:11 PM To: CF-Talk Subject: Date Function Hello All, Here is a good one. I have been thinking about this for a while and I can not figure it out! I am doing a schedule thing and I need to see if let's say at the time it goes, if we are the 1st of the month to get yesterday's date. So I cab take that and format it with dateformat Does anyone know how this would be accomplished? Thanks, Joel __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date Function
I'm not quite sure what you are asking. Are you trying to determine if you are on the first day of the month? cfif day(now()) is 1 It's the 1st. Arm the Star Destroyers /cfif === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus My ally is the Force, and a powerful ally it is. - Yoda -Original Message- From: Joel Blanchette [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 3:11 PM To: CF-Talk Subject: Date Function Hello All, Here is a good one. I have been thinking about this for a while and I can not figure it out! I am doing a schedule thing and I need to see if let's say at the time it goes, if we are the 1st of the month to get yesterday's date. So I cab take that and format it with dateformat Does anyone know how this would be accomplished? Thanks, Joel __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date Function
Yeah basically...Like tomorrow when the scheduler execute the script I need it to say if today is 1st of the month, the day before was... Joel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 2:16 PM To: CF-Talk Subject: RE: Date Function I'm sorry, I'm not sure what you are asking. Are you asking how to get the previous day's date? Kathryn Butterly Web Developer Washington Mutual Finance 813 632-4490 [EMAIL PROTECTED] -Original Message- From: Joel Blanchette [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 3:11 PM To: CF-Talk Subject: Date Function Hello All, Here is a good one. I have been thinking about this for a while and I can not figure it out! I am doing a schedule thing and I need to see if let's say at the time it goes, if we are the 1st of the month to get yesterday's date. So I cab take that and format it with dateformat Does anyone know how this would be accomplished? Thanks, Joel __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date Function
You mean you want to get yesterdays date? Sounds like you've been trying to subtract 1 from the date, since your having problems if the date is on the 1st. Try using DateAdd() So if your date is march 1st. cfset yourdate = 03/01/2001 User DateAdd to subtract 1 day. cfset yesterday = DateAdd(d,-1,yourdate) And output it with dateformat. cfoutput#DateFormat(Variables.yesterday,mm/dd/)#/cfoutput _ steve oliver senior internet developer atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: Joel Blanchette [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 3:11 PM To: CF-Talk Subject: Date Function Hello All, Here is a good one. I have been thinking about this for a while and I can not figure it out! I am doing a schedule thing and I need to see if let's say at the time it goes, if we are the 1st of the month to get yesterday's date. So I cab take that and format it with dateformat Does anyone know how this would be accomplished? Thanks, Joel __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date Function
To get the date before, just do: cfset yesterdayMyDreamsSeemedSoFarWay = dateAdd(d,-1,now()) This will simply go back one day from the current date. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus My ally is the Force, and a powerful ally it is. - Yoda -Original Message- From: Joel Blanchette [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 3:18 PM To: CF-Talk Subject: RE: Date Function Yeah basically...Like tomorrow when the scheduler execute the script I need it to say if today is 1st of the month, the day before was... Joel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 2:16 PM To: CF-Talk Subject: RE: Date Function I'm sorry, I'm not sure what you are asking. Are you asking how to get the previous day's date? Kathryn Butterly Web Developer Washington Mutual Finance 813 632-4490 [EMAIL PROTECTED] -Original Message- From: Joel Blanchette [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 3:11 PM To: CF-Talk Subject: Date Function Hello All, Here is a good one. I have been thinking about this for a while and I can not figure it out! I am doing a schedule thing and I need to see if let's say at the time it goes, if we are the 1st of the month to get yesterday's date. So I cab take that and format it with dateformat Does anyone know how this would be accomplished? Thanks, Joel __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Date Function
cfif day(now()) is 1 cfset yesterday = dateadd(d,-1,now()) /cfif -Original Message- From: Joel Blanchette [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 3:18 PM To: CF-Talk Subject: RE: Date Function Yeah basically...Like tomorrow when the scheduler execute the script I need it to say if today is 1st of the month, the day before was... Joel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 2:16 PM To: CF-Talk Subject: RE: Date Function I'm sorry, I'm not sure what you are asking. Are you asking how to get the previous day's date? Kathryn Butterly Web Developer Washington Mutual Finance 813 632-4490 [EMAIL PROTECTED] -Original Message- From: Joel Blanchette [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 3:11 PM To: CF-Talk Subject: Date Function Hello All, Here is a good one. I have been thinking about this for a while and I can not figure it out! I am doing a schedule thing and I need to see if let's say at the time it goes, if we are the 1st of the month to get yesterday's date. So I cab take that and format it with dateformat Does anyone know how this would be accomplished? Thanks, Joel __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: date function
Use the dateformat function #dateformat(date," d ")# Chris Giminez Owner - Cyber Scriber Web Site Design 831-728-4469 ICQ# 2628000 I have a source that is outputting dates in this format: 26-May-2000 10:55:16 -0500 It doesn't seem that any of CF's date functions want to touch it. I was = wanting to decrease the amount of overhead on the server by not messing = with the trim and replace functions, especially seeing that this is = going to be a very repetitive function. Does anyone have any = suggestions or am I doing something wrong? I would like an output of = May 26 2000. I guess I could trim after the first whitespace and then = do formatting from there, but if anyone has a better suggestion I would = appreciate it. Adam Cantrell -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
date function
This is a multi-part message in MIME format. --=_NextPart_000_00C6_01BFCF09.72BC94C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have a source that is outputting dates in this format: 26-May-2000 10:55:16 -0500 It doesn't seem that any of CF's date functions want to touch it. I was = wanting to decrease the amount of overhead on the server by not messing = with the trim and replace functions, especially seeing that this is = going to be a very repetitive function. Does anyone have any = suggestions or am I doing something wrong? I would like an output of = May 26 2000. I guess I could trim after the first whitespace and then = do formatting from there, but if anyone has a better suggestion I would = appreciate it. Adam Cantrell --=_NextPart_000_00C6_01BFCF09.72BC94C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" HTMLHEAD META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR STYLE/STYLE /HEAD BODY bgColor=3D#ff DIVnbsp;/DIV DIVFONT face=3DArial size=3D2I have a source that is outputting = dates in this=20 format:/FONT/DIV DIVnbsp;/DIV DIVFONT face=3DArial size=3D226-May-2000 10:55:16 -0500/FONT/DIV DIVnbsp;/DIV DIVFONT face=3DArial size=3D2It doesn't seem that any of CF's date = functions=20 want to touch it.nbsp; I was wanting to decrease the amount of overhead = on the=20 server by not messing with the trim and replace functions, especially = seeing=20 that this is going to be a very repetitive function.nbsp; Does anyone = have any=20 suggestions or am I doing something wrong?nbsp; I would like an output = of May=20 26 2000.nbsp; I guess I could trim after the first whitespace and then = do=20 formatting from there, but if anyone has a better suggestion I would = appreciate=20 it./FONT/DIV DIVnbsp;/DIV DIVFONT face=3DArial size=3D2Adam = Cantrell/FONT/DIV/BODY/HTML --=_NextPart_000_00C6_01BFCF09.72BC94C0-- -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Odd date function behavior
Hello all, Using the following cfset olddate = DateFormat(DateAdd("d", -30, Now())) works as expected. What's odd is the original code was written like this: cfset olddate = DateFormat(DateAdd("d", Now(), -30)) This didn't produce an error, either in the cfset, or in the query where 'olddate' was used. Both formats return 3/25/2000. From the docs, the correct syntax is DateAdd(datepart, number, date), as in the first example. Am I missing something here? - Jeff Beer Programmer Hydrogen Media, Inc. www.hydrogenmedia.com Phone: 888.890.9175 Fax: 727.530.5588 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Odd date function behavior
Now() is simply a number (equivalent to the number of seconds that have passed since December 31, 1899 if I'm not mistaken). The DateAdd function simply adds the two numbers that you enter. So, there really is no problem with the order that you enter the parameters since it's just the addition of two number... HTH, Howie Hamlin -- inFusion Project Manager; On-Line Data Solutions, Inc. (631)737-4668 === Please vote for iMS in the Most Innovative category here: *** http://www.sys-con.com/ColdFusion/readerschoice2000/ *** === Check out inFusion Mail Server - the world's most configurable email server *** inFusion Authenticator for IIS is now released! (download from CoolFusion.com) *** http://www.teletrends.com and http://www.coolfusion.com Software and utilities for ColdFusion, iHTML, Website, NTMail Latest versions available from our web site (inFusion Authenticator version 2.0 for WebSite and NTMail is now released) - Original Message - From: Jeff Beer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 24, 2000 11:25 AM Subject: Odd date function behavior Hello all, Using the following cfset olddate = DateFormat(DateAdd("d", -30, Now())) works as expected. What's odd is the original code was written like this: cfset olddate = DateFormat(DateAdd("d", Now(), -30)) This didn't produce an error, either in the cfset, or in the query where 'olddate' was used. Both formats return 3/25/2000. From the docs, the correct syntax is DateAdd(datepart, number, date), as in the first example. Am I missing something here? - Jeff Beer Programmer Hydrogen Media, Inc. www.hydrogenmedia.com Phone: 888.890.9175 Fax: 727.530.5588 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.