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 29+ years Cloverleaf, 59 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.

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,432
Topic Tags
286
Empty Topic Tags
10