Thanks Bill.  That works perfectly.  
Hope all is well. 

 

From: [email protected]
Date: Tue, 7 May 2013 14:51:41 -0400
Subject: [RBASE-L] - Re: Time Calc
To: [email protected]

Hi, Tommy!
SET VAR vHours INT = (INT(133920/3600)) -- gives you hours (3600 seconds in an 
hour)SET VAR vSecsLeft INT = (MOD(133920,3600)) -- gives you left over seconds 
after you got the hours.

SET VAR vMins INT = (INT(.vSecsLeft/60)) -- gives you truncated minutes, orSET 
VAR vMins INT = (NINT(.vSecsLeft/60)) -- gives you rounded minutes


To create a string of the whole thing as a single expression (I got 37 hours 12 
minutes from your example, not 13 minutes), 
SET VAR vHHMMString = +

  ( +  CTXT(INT(.vTotalSeconds / 3600 )) + ':' + +  
TRIM(FORMAT((NINT((MOD(.vTotalSeconds,3600)/60))),'00')) +

  )
The FORMAT makes sure that if it is fewer than 10 minutes, it comes out as 
37:09, not 37:9

The TRIM gets rid of a space at the front of the minutes string, left by the 
FORMAT function


Bill

On Tue, May 7, 2013 at 2:23 PM, Tommy Croker <[email protected]> wrote:







Is there a function that I can enter 133920 seconds and have the output be 
37:13 for 37 hours and 13 minutes?  The RTime function seems to only work on 24 
hour basis.  




Thanks
                                          

                                          

Reply via email to