|
Scott,duration value of the difference between two timestamps in HH:MM:SS format?
Given that concern, what would you recommend as the best method to get a
V5R2
Thanks,
Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions
IBM Certified Specialist- e(logo) server i5Series Technical SolutionsDesigner V5R3
IBM Certified Specialist- e(logo)server i5Series Technical SolutionsImplementer V5R3
________________________________
From: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
To: RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
Sent: Mon, May 24, 2010 1:40:09 PM
Subject: Re: Difference between 2 time values expressed in hh:mm:ss format
Hi Brian,
When you give this answer again (and you will -- I've given it at least
twice a month for the past 4 years) please add a disclaimer.
The disclaimer is that the TIME data type was not intended to store a
DURATION. It was meant to identify a particular moment of the day, not
to express an amount of time that has passed.
Consequently, it does not work well for this sort of thing. For
example, if there's 15 hours and 20 minutes have elapsed between a
start/end timestamp, and you format the time in USA format, it'll say
"3:20 PM" It identifies a time of the day, not a number of hours that
elapsed.
Likewise, if you try to exceed 24 hours, you'll get an error. For
example, you can't make it say 26 hrs, 5 minutes. Why not? Because it
identifies a time of day, and there's no 26 O'Clock.
So while the technique you propose does have value in certain
circumstances, you should understand that you're doing something that
wasn't really intended -- and therefore won't always do what you expect.
On 5/24/2010 9:04 AM, BMay@xxxxxxxxx wrote:
Use the %Diff Bif to get the difference in seconds. Then add the seconds
to a time field set for midnight (00:00:00).
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.