|
Andy wrote: >I have two date fields *MDY with these values. >'18:09:04' and '16:26:57'. >All I want to do is find the total elapsed >time in hours,minutes and seconds >between them. > >I'm using the SUBDUR like this; > >EndTime SUBDUR StartTime Hour:*H >EndTime SUBDUR StartTime Minute:*MN >EndTime SUBDUR StartTime Second:*S > >Hour,Minute and second are part of a 6,0 data structure. >When I put my program in debug my 'elapsed' variable >contains 010227. I suspect its because of negatives I'm >getting the minutes and seconds the way I am. > >What am I missing here? (Should I be doing this differently >then SUBDUR?) I read the manual as saying that we subtract 16.26.57 from 18.09.04 and come up with the result expressed in whole hours, which in this case is 1. For *M, it means express the result in minutes, which is 102 minutes (truncated to 02). You get the idea, I'm sure. Read the RPG Reference: Operation code SUBDUR, and Date Operations for more details. --buck
As an Amazon Associate we earn from qualifying purchases.
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.