Dividing by 60 as an integer gives you the "hours"
Using the "mod" command with a base of 60 gives you the remaining minutes.

     ^
    / \__
   (    @\___
  /          O
 /    (_____/
/_____/
Whoof...
410-757-3487

-----Original Message-----
From:   Jeffrey Davis [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, May 22, 2001 11:15 PM
To:     CF-Talk
Subject:        Subject: SLightly OT - a time formula 


Will,

Probably could write this as one line of code, but basically (and this is
off top of head, using someone elses machine, web browser but no CF or
Studio to help check, so this is pseudo-code)
<cfset TotalOfMinutes=400>
<cfset HoursResult = Integer(TotalOfMinutes/60)>
<cfset MinutesResult = TotalOfMinues Mod 60>
<cfoutput> #HoursResult#hrs. #MinutesResult#minutes</cfoutput>

Jeff Davis
Fig Leaf Software
"We've Got You Covered!"

  Hi all, 

  This is slightly OT, but refers to a cf project so I guess it is relevant
in 
  a way. Does anyone know a formula for calculating time. I have numbers of 
  minutes, and need to calculate the time in hours and minutes from these. 

  For example, I have the figure of 400 minutes. I need to calculate how
many 
  hours and minutes this is. Dividing by 60 won't do the job, it gives an 
  answer of 6.66666666. What I need is a formula that will give me the
correct 
  answer: 6hrs 40minutes. 

  Anyone know a nice formula for calculating this? 

  TIA 

  Will 

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to