You could also put the CUR_DATE or CUR_TIME field directly into the Result field of the TIME opcode. Bob Cozzi email@example.com Visit the on-line Midrange Developer forum at: http://www.rpgiv.com > -----Original Message----- > From: firstname.lastname@example.org [mailto:email@example.com] On > Behalf Of Seth.D.Shields@blum.com > Sent: Thursday, January 10, 2002 4:01 PM > To: firstname.lastname@example.org > Subject: Re: RPG IV Date Question > > > >> how do you get today's date into a date field? > > > The code below will place the current date in Cur_Date and the current time in > Cur_Time. Now you can use MOVE to place Cur_Date in > any other date field you wish. > > > > D ds > D TimStp z > D Cur_Date d Overlay(TimStp:1) > D Cur_Time t Overlay(TimStp:12) > > D TodaysDate d DatFmt(*iso) > > > C Time TimStp > > C Move Cur_Date TodaysDate > > > Beware of using UDATE or *DATE. They will give you the date the job starting > which may not be the current date. > > Also, if you're on V5R1, there is a more elegant way with the new Biffs: > > > D TodaysDate d DateFmt(*iso) > > /free > > TodaysDate = %date(); > > /end-free > > Kind regards, > Seth Shields > Julius Blum Inc. > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-Lemail@example.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l.
This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact