That'll do it, but you could save an operation by using the \ operator to
get the full number of days.

<cfset hoursPerDay = 24>
<cfset totalHours = DateDiff("h", date1, date2)
<cfset days = (totalHours \ hoursPerDay)>
<cfset hours = (totalHours mod hoursPerDay)>

If totalHours = 36, days = (36 \ 24) = 1, hours = (36 mod 24) = 12.

-David

P.S. My Allaire Developer Conference *unofficial* sign-ip sheet is back
up, at
www.cfm-resources.com/members/dshadovi/index.html. If you're coming, sign
up!

On Sat, 7 Oct 2000 09:23:11 -0400 "Kevin Langevin" <[EMAIL PROTECTED]>
writes:
> MOD the resulting hours by 24 to get the stray hours, and divide the
> resulting hours by 24 and INT() the results to get the full number 
> of days.
> 
> Now I just woke up, so forgive me if there's a glaring, simpler 
> solution...
> :)
> 
> <CFUG-SFL Manager>
> -Kev
> </CFUG-SFL Manager>
> 
> > -----Original Message-----
> > From: Chris Lott [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, October 06, 2000 8:52 PM
> > To: CF-Talk
> > Subject: Datediff to days, hours
> >
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Is there a simple way to turn a standard datediff result into a 
> format
> > like:
> > 1 day, 12 hrs
> >
> > Instead of 36 hours or 1.5 days?
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to