Date Format

  • Creator
    Topic
  • #49274

    I have used the DATECOPYOPT option to turn of the time value. Could some one please advise the procedure to format the date value: from yyyymmdd in to yyyy-mm-dd or yyyy/mm/dd using the translation.

    Thanks

    Shad

Viewing 5 reply threads
  • Author
    Replies
    • #61336
      Jim Kosloskey
      Participant

        I am going to make an assumption you are speaking about HL/7 messages.

        You will need to use Tcl to do the formatting.

        Jim Kosloskey

        email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

      • #61337

        Jim,

        Yes, the messages are in HL7 format.  Could you please provide me the sample script?

        Thanks

        Shad

      • #61338
        Charlie Bursell
        Participant

          To convert from YYYYMMDD to yyyy-mm-dd

          set newDate [clock format [clock scan $oldDate] -format “%Y-%m-%d”]

          To convert from YYYYMMDD to yyyy/mm/dd

          set newDate [clock format [clock scan $oldDate] -format  “%Y/%m/%d”]

        • #61339
          David Barr
          Participant

            This is probably a little more efficient than the “clock scan” option:

            Code:

            regsub {(….)(..)(..)} $oldDate {1-2-3} newDate

          • #61340

            Thanks for the all responses. I got it working..

            Thanks

            Shad

          • #61341
            Lee Wilson
            Participant

              Please share with the rest of us.

          Viewing 5 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.