Use createdatetime() and set the time to midday. This will avoid any issues that may arise due to day/time differences.
-- Michael Dinowitz On Tue, Mar 2, 2010 at 9:19 PM, Les Mizzell <[email protected]> wrote: > > This one is a little weird and has me tearing out my hair. > > I've manage a site in Guernsey (off the coast of France). I've written a > CFC that lives on a server here in the states to collect info and write > to a database here, not in Guernsey. I'm passing *integer* fields for > month, day, year - and combining them into dates here in the states > instead of the Guernsey side because of previous calculation problems. > Tiome zone differences? Was the only thing I could figure... > > So, I pass the numbers to the CFC: > > WSdepDAY="#form.depDAY#" > WSdepMONTH="#form.depMONTH#" > WSdepYEAR="#form.depYEAR#" > WSretDAY="#form.retDAY#" > WSretMONTH="#form.retMONTH#" > WSretYEAR="#form.retYEAR#" > > > combine the numbers and create a date: > > <cfset req.departdate = #createDATE(WSdepYEAR,WSdepMONTH,WSdepDAY)# /> > <cfset req.returndate = #createDATE(WSretYEAR,WSretMONTH,WSretDAY)# /> > > Then I run the calc > > <cfset req.daysAway = #DateDiff("D",req.departdate,req.returndate)#+1 > > > Easy enough, right? > > So, a depart date of April 1 and a return date of April 10 = 10 travel days. > > BUT - it doesn't always return a correct amount, depending on dates > entered. March 9-20 was only calculating as 11 days instead of 12, but a > test immediately after different dates comes back correct. Returning to > the same March dates - it's a day off again... > > Anybody have ANY ideas whatsoever? I sure don't.... > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4910 (20100302) __________ > > 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:331330 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

