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



Mark,

I believe you can use the MOVE opcode against a defined timestamp variable
in RPG.  The following seems to work at V5R1, with later releases having
more robust %bif support for date conversion....  Perhaps this might help...

d numDate         S              8  0 inz(20040701)      
d numTime         S              4  0 inz(0915)          
d AmPmFlag        S              1    inz('P')           
d wrkTime         S              6  0                    
d dtmDate         S               D   datfmt(*Iso)       
d dtmTime         S               T                      
d dtmTimestamp    S               Z                      
                                                         
c                   eval      wrkTime = numTime * 100    
c                                                        
c                   If        AmPmFlag = 'P'             
c                   eval      wrkTime = wrkTime + 120000 
c                   EndIf                                
c                                                        
c     *Iso          Move      numDate       dtmDate      
c                   Move      wrkTime       dtmTime      
c                                                        
c                   Move      dtmDate       dtmTimestamp 
c                   Move      dtmTime       dtmTimestamp 
c                                                              
c     dtmTimestamp  dsply                                      
c                                                              
c                   eval      *inlr = *on                      

Eric DeLong
Sally Beauty Company
MIS-Project Manager (BSG)
940-898-7863 or ext. 1863



-----Original Message-----
From: Don [mailto:dr2@xxxxxxxxxxxx]
Sent: Wednesday, July 14, 2004 3:51 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Convert and Duration




Cozzi used to have a date/time duration calculation handout on his
website, but I think it disappeared...

Don in DC

--------------------------------------------------
On Wed, 14 Jul 2004, Mark Allen wrote:

> I've got a file with an 8 digit date (CCYYMMDD), a 4 digit time field
(HHMM)
> and a field that contains either a.m. or p.m. I can convert the time field
> easily enough to be 24 hr time by adding 12 to hr field if pm and making
> seconds 0.
>
> Where I am stuck is how to get the duration between two sets of
dates.times.
> I know I probably need to move to date/time type fields but after that.
> would like time duration to be in hrs/minutes.
>
> Thanks
>
> Mark Allen
> IS Manager
> Wilkes Telephone & Electric
> 11 W. Court Street
> Washington, GA 30673
> Phone: (706) 678-9565
> Cell: (706) 498-7907
> Fax: (706) 678-1000
>

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