Ok...daylight savings time. I wish they'd do away with that archaic time hack...
-----Original Message----- From: Les Mizzell [mailto:[email protected]] Sent: Wednesday, March 03, 2010 1:31 PM To: cf-talk Subject: Re: date calculations driving me batty!! > <cfset req.hours = #DateDiff("h",req.departdate,req.returndate)#+25)> > <cfset req.daysAway = int(req.hours/24)> Rick Faircloth wrote: > And what turned out to be the reason for adding "+25" to the calculation? I'm calculating the number of travel days in a trip. This would include the day you depart and the day you return. So if you depart on the 1st and return on the 10th, that's 10 travel days. DateDiff would give me 9 days - so you add 1 to get the correct amount. Howevever, because of the way datediff handles daylight savings time (ack!), instead of adding 24 hours (one day) - I needed to add 25 hours to make up for the dropped hour. __________ Information from ESET NOD32 Antivirus, version of virus signature database 4913 (20100303) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331320 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

