|
Peter, Do you know about using MOVE to convert between non-date and non-time values to date and time values? Anyway, this works: D tmData S 6A Inz('152000') D myTime S T D msecs S 10I 0 C C *HMS0 MOVE tmData MyTime C T'00:00:00' SubDur MyTime MSecs:*MS The value of TMData is set to 3:20 PM as an example. -Bob > > "Peter, did you see my response on how to do this?" > Yes Bob, I am sorry...I guess I was answering other postings as > well... > > "One line of code in RPGIV. Of course if your original value is > character, you > need to first move it into a TIME field in RPG." > > To help you all visualize what I have, here it is the pgm: > > * Entry parameters > D CurDate s 6 > D CurTime s 6 > D millisec s 8T > * Work fields > D CurDateLong s 10 > D CurTimeLong s 8 > D ds > D SysDateTime Z INZ(*LOVAL) > D SysDate 1 10D DATFMT(*ISO) > D SysTime 12 19T TIMFMT(*ISO) > *----------------------------------------------------- > D* Calculations > D*----------------------------------------------------- > D* > D* Entry parameters > *entry plist > D parm CurDate > D parm CurTime > D* > * > * Pull system date and time > C Time SysDateTime > C *ISO move SysDate CurDateLong > C *ISO move SysTime CurTimeLong > C Eval CurDate = %subst(CurDateLong:6:2) + > Month > C %subst(CurDateLong:9:2) + > Day > C %subst(CurDateLong:3:2) > Year > C Eval CurTime = %subst(CurTimeLong:1:2) + > Hours > C %subst(CurTimeLong:4:2) + > Minutes > C %subst(CurTimeLong:7:2) > Seconds > * > * Convert time from HHMMDD to milliseconds > C Eval Millisec = ???? > >>> > >>> Bob's recommendation > C MyTime SUBDUR T'00:00:00' Mili:*MS > >>> > >>> > C endif > C eval *inlr = *on > > What should be "MyTime"? SysTime? CurTimeLong? > Is "Mili" the equivalent of my "milisec" variable? > What is the equivalent coding if I want to use an EVAL statement? > > > > Peter Vidal > Pall Aeropower Corp. > SR Programmer Analyst > WWW.Pall.com / 727-539-8448, x2414 > > "A good player makes himself look good; a great player makes the > team look > good." > Author unknown > > > _______________________________________________ > 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-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.