ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Most efficient method to display 02/12/2012

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Most efficient method to display 02/12/2012

    Hi, I have a subfile maintenance program and trying to come up with the most efficient way of displaying my date as DD/MM/YYY. My date in the file is 20120212. I want to display it as 02/12/2012.
    Thanks,

    DAC

  • #2
    Re: Most efficient method to display 02/12/2012

    Define your subfile field as Date with format USA.

    In your RPG-Program simply convert the numeric or character date 20120212 into your real date subfile field:
    1. Assumed 20120212 is a numeric date:
    Code:
     /Free
       MySflDate = %Date(MyNumDate: *ISO);
    2. Assumed 20120212 is a character date:
    Code:
     /Free
       MySflDate = %Date(MyCharDate: *ISO0);
    Birgitta

    Birgitta

    Comment

    Working...
    X