Clovertech
› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Date Format
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
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.
Jim,
Yes, the messages are in HL7 format. Could you please provide me the sample script?
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”]
This is probably a little more efficient than the “clock scan” option:
regsub {(….)(..)(..)} $oldDate {1-2-3} newDate
Thanks for the all responses. I got it working..
Please share with the rest of us.