MIDRANGE dot COM Mailing List Archive

Home » RPG400-L » January 2002

RE: RPG IV Date Question


You could also put the CUR_DATE or CUR_TIME field directly into the
Result field of the TIME opcode.

Bob Cozzi
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]
> 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
> which may not be the current date.
> Also, if you're on V5R1, there is a more elegant way with the new
> 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
> 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.

Return to Archive home page | Return to MIDRANGE.COM home page

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