Combining mine and Daniel's ideas, heres the fastest version I could
make...19 ms on my server.

<cfscript>
        seconds = 5600.25;
        hours = seconds \ 3600;
        seconds = seconds mod 3600;
        minutes = seconds \ 60;
        seconds = seconds mod 60;
</cfscript>

<cfoutput>#hours#:#minutes#:#seconds#</cfoutput>

Brian

-----Original Message-----
From: Jason Larson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 3:39 PM
To: CF-Talk
Subject: RE: Converting Seconds to Hours,Minutes,Seconds


Thanks, that's what I was looking for.

Jason

-----Original Message-----
From: Daniel Lancelot [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 1:33 PM
To: CF-Talk
Subject: RE: Converting Seconds to Hours,Minutes,Seconds


Try this - it works...

<cfscript>
        numsecs = 5600.25;
        hours = int(numsecs/3600);
        minutes = int((numsecs / 60) - (hours * 60));
        seconds = numsecs - (hours * 3600) - (minutes * 60);
</cfscript>
<cfoutput>
#hours#:#minutes#:#seconds#
</cfoutput>

-----Original Message-----
From: Jason Larson [mailto:[EMAIL PROTECTED]]
Sent: 20 March 2001 20:01
To: CF-Talk
Subject: Converting Seconds to Hours,Minutes,Seconds


I was wondering if there is anybody out there that has a piece of code that
will help me solve my little problem that I am having? I need to take a
number i.e. 5600.25 seconds, and find out how many hours are in that number,
how many minutes, and how many seconds are remaining. New to CF, and I am
struggling a little bit on this one.

Thanks for your help
Jason Larson
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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