You could also put the CUR_DATE or CUR_TIME field directly into the Result field of the TIME opcode. Bob Cozzi firstname.lastname@example.org Visit the on-line Midrange Developer forum at: http://www.rpgiv.com > -----Original Message----- > From: email@example.com [mailto:firstname.lastname@example.org] On > Behalf Of Seth.D.Shields@blum.com > Sent: Thursday, January 10, 2002 4:01 PM > To: email@example.com > 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-Lfirstname.lastname@example.org > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l.
This mailing list archive is Copyright 1997-2015 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