× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Sounds good.  I tested this a while back and *I think* it worked.  You could
make some sort of procedure to convert a duration into HHMMSS ...  

HHMMSS = #cvtToHHMMSS( duration : format ) 

... or something like that.

 /free                                                  
                                                        
  for i = 1 to nbrOfTimes;                              
                                                        
  workTime = %time( numericTime : *ISO );               
                                                        
  totalSeconds = totalSeconds                           
               + ( %subdt( workTime : *HOURS ) * 3600 ) 
               + ( %subdt( workTime : *MINUTES ) * 60 ) 
               +   %subdt( workTime : *SECONDS );       
                                                        
  endfor;                                               

  hours = %div( totalSeconds : 3600 );                   
  minutes =  %div( %rem( totalSeconds : 3600 ) : 60 );   
  seconds =  %rem( %rem( totalSeconds : 3600 ) : 60 );   
                                                         
  *inlr = *on;                                           
                                                         
 /end-free  


-----Original Message-----
From: Booth Martin [mailto:Booth@xxxxxxxxxxxx]
Sent: Wednesday, February 26, 2003 1:54 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: calculate the difference between two time stamps in
hh:mm:ss


Not many gyrations.
 
subdur = total seconds
total seconds divided by 60 = Hours
the remainder is seconds
Hours divided by 60 = Hours
the remainder = minutes.
 
That should do it.  Don't half adjust.  
 
(Prays to the gods of stupidity.  I sure hope I don't win their blessings
today. I did not test this.)
 
---------------------------------------------------------
Booth Martin   http://www.MartinVT.com
Booth@xxxxxxxxxxxx
---------------------------------------------------------
 
-------Original Message-------
 
From: RPG programming on the AS400 / iSeries
Date: Wednesday, February 26, 2003 13:26:55
To: RPG programming on the AS400 / iSeries
Subject: Re: calculate the difference between two time stamps in hh:mm:ss
 
Doc and Mark
 
Thanks for the replies. I tried %diff and subdur, - (%diff was one of my
examples) but they will give me the hours, minutes OR seconds, but not all
three at once.
 
I was hoping that by specifying a time data field as the result would give
me what I wanted, but my thinking was wrong that a valid 'time' is not the
same thing as a timed duration.
 
I hoped i wouldn't have to go thru the gyrations of calculating the
hh:mm:ss from the *seconds, but it looks like i'll have to.
 
Thanks anyway,
 
Rick

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.