× 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.




I sorry, but isn't milliseconds actually hundreds of a second?

1 millisecond is 1/1000 (one thousandth) of a second.

However, your message did clue me in to what (I think) Willie is looking for. What was stumping me, was that he kept asking for the time in "hundreds". I see the same thing in your post, in the above sentence you refer to "hundreds" when you meant "hundredths" and that was what was fouling me up. I was trying to think of some unit of time that commonly represented things in 1 hundred minutes at a time, or 1 hundred hours at a time, and that didn't make sense.

What I think Willie is looking for is time represented in 1 hunredths of a hour. In other words, he's looking for a difference of two times that's expressed in whole hours and/or decimal fractions, instead of hours and minutes.

To do this in RPG IV is very easy, since it's just a matter of getting the time in seconds, and dividing it to get hours -- decimal fractions are no problem, since math is normally done in decimals :)

For example, to get the difference between 10:29am and 1:15pm, you'd figure out how many seconds there are between those two times, and then divide it by 3600 to find out the hours with a decimal fraction:

     D ts1             s               z
     D ts2             s               z
     D hours           s              5P 2
     D SECSPERHOUR     C                   const(3600)

      /free

         ts1 = z'2006-12-04-10.29.00';
         ts2 = z'2006-12-04-13.15.00';

         hours = %diff(ts2:ts1:*seconds) / SECSPERHOUR;

         dsply %char(hours);
         *inlr = *on;

      /end-free


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.