I stand corrected. That only calculated up to days.. I need months and years (and not just the calculation, but actual days and months..
Grrr... Going to get some wake up juice. :) On Sat, Aug 9, 2014 at 6:40 AM, Phillip Vector <[email protected]> wrote: > Found this.. > > http://www.cflib.org/index.cfm?event=page.udfbyid&udfid=377 > > This seems to work. Thanks anyway. :) > > > On Sat, Aug 9, 2014 at 5:40 AM, Phillip Vector <[email protected]> > wrote: > >> So I want to display the time between 2 events (down to the second). I >> have the following code.. >> >> <cfset Years = #DateDiff("yyyy", >> Leaderboard.CreatedOn, Leaderboard.DateOfDeath)# + 18> >> <cfset Months = #DateDiff("yyyy", >> Leaderboard.CreatedOn, Leaderboard.DateOfDeath)#> >> <cfset Days = #DateDiff("yyyy", >> Leaderboard.CreatedOn, Leaderboard.DateOfDeath)#> >> >> #Years# Years, #Months# months and #Days# days >> >> However, as you may have noticed, it produces an output like this.. >> >> 0 Years, 5 months and 174 days >> >> What I'm hoping it would say is something like >> >> 0 Years, 5 months and 24 days >> >> (but I would need to then figure out if the months between it contain 30 >> or 31 (or 29 or leap year 28).. >> >> Does anyone have something already coded before I try to tackle this? I'd >> hate to invent the wheel and my Google Fu doesn't come up with anything >> (Then again, it is 5:40am where I am and I just woke up). :) >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359099 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

