How do you put the system date into *ISO format?

5 pts.
Tags:
ISO
RPGLE
Update an *ISO date in RPGLE?

Answer Wiki

Thanks. We'll let you know when a new response is added.

these sites might help you:

If not, you might want to be a bit more specific.
Good Luck!
-Flame
***************************

The date data fields are all held internally the same way, the date format is a purely visual thing. For example, you could have the following (spacing not exact):

D IsoDate s d DatFmt(*ISO) Inz(d'2008-10-31)
D UsaDate s d DatFmt(*USA) Inz(d'07/04/2008')
D EurDate s d DatFmt(*EUR) Inz(d'25/12/2008')

D MyDate s d DatFmt(*ISO) Inz(*Sys)

C MyDate Dsply
C Eval MyDate = IsoDate
C MyDate Dsply
C Eval MyDate = UsaDate
C MyDate Dsply
C Eval MyDate = EurDate
C MyDate Dsply
C Eval MyDate = %Date()
C MyDate Dsply
C

When you run the program you should see the current date, 2008-10-31, 2008-07-04, 2008-12-25 and the current date displayed in sequence. What this demonstrates is that no matter what format the incoming date, the resulting date field shows it in its own format. The %Date() function returns the current system date.

IIf you know the format of the incoming date you can specify it in the %Date() function. For example:

Eval MyDate = %Date(d’07/04/2008′ : *USA)

Jonathan
*******************************************************

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Modiyooch
    Dtdate s d datfmt(*iso) c time tdate
    540 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following