Razzak:

I did not, and thank you. I recommend that anyone also interested in Date/Time math look at the companion RTimeLapseEx Plugin, which ups the game considerably.

Best to you and the Blue Crew, Bruce

Bruce A. Chitiea
SafeSectors, Inc.
-----------------------------------
112 Harvard Ave #272
Claremont CA 91711-4716
-----------------------------------
[email protected]
-----------------------------------
+011 (909) 238-9012 c
+011 (909) 912-8678 f


------ Original Message ------
From: "A. Razzak Memon" <[email protected]>
To: [email protected]
Sent: 7/14/2020 8:27:50 PM
Subject: Re: [RBASE-L] - Converting TIME Value to REAL Value

Bruce,

Did you know that you can use the RTimeLapse Plugin to calculate the most 
accurate elapsed time, including Days, Hours, and Minutes?

RTimeLapse is part of RBASEPluginPowerPackX5 Plugin.

-- Example:
   SET VAR vStartDate DATE = NULL
   SET VAR vStartTime TIME = NULL
   SET VAR vEndDate DATE = NULL
   SET VAR vEndTime TIME = NULL
   SET VAR vRBTIDays INTEGER = NULL
   SET VAR vRBTIHours INTEGER = NULL
   SET VAR vRBTIMins INTEGER = NULL
   SET VAR vCommand TEXT = NULL
   SET VAR vResult TEXT = NULL
   SET VAR vStartDate = (ADDDAY(.#DATE,-1))
   SET VAR vStartTime = (ADDMIN(.#TIME,-90))
   SET VAR vEndDate = (.#DATE)
   SET VAR vEndTime = (.#TIME)
   SET VAR vCommand = +
   ('PLUGIN RTimeLapse vResult' + +
    '|START_DATE'&(CTXT(.vStartDate)) + +
    '|START_TIME'&(CTXT(.vStartTime)) + +
    '|STOP_DATE '&(CTXT(.vEndDate)) + +
    '|STOP_TIME '&(CTXT(.vEndTime)))
   &vCommand
   RETURN

-- Notice the resulting vRBTIDays, vRBTIHours, and vRBTIMins variables as 
follows:
   SHOW VARIABLES
   vStartDate = 07/13/2020 DATE
   vStartTime = 09:48 PM TIME
   vEndDate = 07/14/2020 DATE
   vEndTime = 11:18 PM TIME
   vRBTIDays = 1 INTEGER
   vRBTIHours = 1 INTEGER
   vRBTIMins = 30 INTEGER

That's all there is to it.

Very Best R:egards,

Razzak


At 07:41 PM 7/14/2020, Bruce Chitiea wrote:

I've been hunting for a simple function to convert a TIME value (e.g. 10:15) to a REAL 
value (e.g. 10.25), to make "elapsed time math" easy.

Something like:Â (DTIME(.vTimeValue))Â ... which I'm not seeing.

This would reduce elapsed-TIME calculations to:

SET VAR vTime_End_DOUBLE =Â (DTIME(.vTime_End_TIME))
SET VAR vTime_Beg_DOUBLE =Â (DTIME(.vTime_Beg_TIME))
SET VAR vTime_Elapsed_DOUBLE = (.vTime_End_DOUBLE - .vTime_Beg_DOUBLE)

I'm absolutely sure I'm just missing something insanely simple. Meanwhile, 
something like Footnote [1] does the job, but forget about putting it in a 
Calculated Column Definition, which is the best place for such a basic 
calculation.

Thanks, Bruce

Bruce A. Chitiea




-- For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/0MQ4Bx-1jzeY40Fil-005J08%40mrelay.perfora.net.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/em4c663112-b3dc-48a2-8fae-325dd3585350%40pathfinder.

Reply via email to