|
Provided that a table contains the start time in RPDFFIAFP and the end time in RPDFINAFP i get the elapsed in this way: ElapsetTime = t'00.00.00' + %seconds(%diff(RPDFFIAFP:RPDFINAFP:*S)) ----- Original Message ----- From: <rob@xxxxxxxxx> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> Sent: Tuesday, February 01, 2005 3:20 PM Subject: Re: Converting minutes to hours/minutes > That's pretty slick. > > Rob Berendt > -- > Group Dekko Services, LLC > Dept 01.073 > PO Box 2000 > Dock 108 > 6928N 400E > Kendallville, IN 46755 > http://www.dekko.com > > > > > > "Hauser, Birgitta" <Birgitta.Hauser@xxxxxxxxxxx> > Sent by: rpg400-l-bounces@xxxxxxxxxxxx > 02/01/2005 09:01 AM > Please respond to > RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> > > > To > "'rpg400-l@xxxxxxxxxxxx'" <rpg400-l@xxxxxxxxxxxx> > cc > > Subject > Re: Converting minutes to hours/minutes > > > > > > > Hi, > > if you really want the difference between two timestamps in Years, Months, > Days, Hours, Minutes, Seconds, Microseconds, > just calculate the difference with SQL. > > The following example shows the difference between 2 Timestamps: > D DS INZ > D DiffDate 20S 6 > D DiffYears 4S 0 overlay(DiffDate) > D DiffMonths 2S 0 overlay(DiffDate: *Next) > D DiffDays 2S 0 overlay(DiffDate: *Next) > D DiffHours 2S 0 overlay(DiffDate: *Next) > D DiffMinutes 2S 0 overlay(DiffDate: *Next) > D DiffSeconds 2S 0 overlay(DiffDate: *Next) > D DiffMSeconds 6S 0 overlay(DiffDate: *Next) > > D Timestamp1 S Z inz(Z'2005-02-01-12.00.00.000000') > D Timestamp2 S Z inz(Z'2005-01-31-10.30.00.000000') > *------------------------------------------------------------------------ > C/EXEC SQL > C+ set :DiffDate = :Timestamp1 - :Timestamp2 > c/END-EXEC > > C DiffDate Dsply > C Eval *InLR = *On > > Birgitta > > -- > 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. > > > -- > 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 mailing list archive is Copyright 1997-2025 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.