ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

converting 03012012 to 20120312

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

  • converting 03012012 to 20120312

    I have a numeric variable and need to convert it to a numeric YYYYMMDD . What is the most efficient way of doing this.

    S1DATE = 03012012 8,p
    Need S1DATE=20120312 8,p

    DAC

  • #2
    Re: converting 03012012 to 20120312

    Even though your S1Date is not the same, you may try:

    Code:
     /Free
        NewNumDate = %Dec(%Date(OldNumDAte: *ISO): *USA);
    Birgitta

    Comment


    • #3
      Re: converting 03012012 to 20120312

      Actually - just backwards... should be:

      Code:
      [COLOR=#000000]NewNumDate = %Dec(%Date(OldNumDAte: *USA): *ISO);[/COLOR]
      It's in USA format - wanting to change it to ISO.

      Comment


      • #4
        Re: converting 03012012 to 20120312

        I always refer to the link below for date conversions.....

        Bloke

        Comment


        • #5
          Re: converting 03012012 to 20120312

          To save Tommy the trouble:
          Attached Files

          Comment


          • #6
            Re: converting 03012012 to 20120312

            LOL - well if you're like me and you browse through examples to improve one's knowledge - it's always good to know that the examples are valid... whether it's 2 years old or current...

            Comment


            • #7
              Re: converting 03012012 to 20120312

              Originally posted by Scott Klement View Post
              To save Tommy the trouble:
              thanks lol
              I'm not anti-social, I just don't like people -Tommy Holden

              Comment

              Working...
              X