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