Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

days, hours, minutes 1

Status
Not open for further replies.

imstillatwork

IS-IT--Management
Sep 26, 2001
1,605
US
here is what i have...

each row has a start and end date,
I use datediff to find the minutes between each date.
I add all the minutes (totaltime) and divide by total rows(issuecount) to get the average time in minutes. Then break it down into days, hours, minutes...

like this:
Code:
				<cfset minute=evaluate(totaltime/issuecount)>
				<cfset hour=evaluate((minute -(minute MOD 60))/60)>
				<cfset day=evaluate((minute -(minute MOD 1440))/1440)>

				#day# day, #hour# hours, #evaluate(minute MOD 60)# mins <br>

the problem is that the MOD does not like it if the average time from datediff has a decimal...
what is the most accurat way to fix this?

thanks
kevin
 
um....well, that code i posted is crap...can someone help me? I know its the weekend, but please? ? :)

thanks

I am given a number that is possibly decimal, it is minutes. want to display it in X days, X hours, X minutes.

thanks
 
You could find the position of the decimal using Find() and then chop it off right at that point, no?

Tony
 
yeah that would work, but you could be chopping off up to 23 hours, 59 minutes, and i want it to be more accurate than that. I'll build somethign like what i started up there, but need to keep track of the remainders better. lemme know if you come up with something.

saw your IM, but came in late.
 
nevermind, you would only be killing up to one minute...I soo need a break from this stuff! :/ thanks

kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top