There are multiple ways to do it. Off the top of my head, if you know that the input will ALWAYS be in that format (YYYYMMDDHHMMSS), then you can use the clock command (copy pre-proc):
<pre>lassign $xlateInVals in_obx_5
set out_obx_5 [clock format [clock scan $in_obx_5 -format “%Y%m%d%H%M%S”] -format “%m/%d/%Y %H:%M”]
set xlateOutVals
</pre>
The problem with using the clock command is that if it doesn’t match the input format on the scan portion, it will fail.
Another way of doing it is to use string range commands to pull out each element of the date and time, and then set the output variable to what you need it to be.
There is also the format command, but I always have to look up all the options for it. Those are the first ones I thought of off the top of my head, but I’m sure there are many other ways as well.
I would put coding before it to verify it matches the input format you are expecting (length, all numeric, etc).
Hope this helps!
Paul Bishop
Carle Foundation Hospital
Urbana, IL