Taking the seconds off a timestamp

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Taking the seconds off a timestamp

  • Creator
    Topic
  • #51308
    Steven Lindsey
    Participant

      In my OBR_7 I have a timestamp that I need to take off the seconds from.  I tried to right a tcl proc but I’m a newbie and can’t figure it out it keeps taking the first two numbers instead of the last two.  If there is away to do it in a Xlate that would work for me.

      Here is copy of my tcl

      lassign $xlateInVals Time

      set Time [string trimright [string range $Time 2 end] ]

      set xlateOutVals

        Thanks

    Viewing 2 reply threads
    • Author
      Replies
      • #69627
        Mason Miller
        Participant

          an easy way to do this is to modify your outbound variant to only allow 12 characters.

        • #69628

          Try it like this.

          Code:

          set date [string range “19720621090100” 0 11]

          -- Max Drown (Infor)

        • #69629
          Robert Kersemakers
          Participant

            Max is right: in your string range command, you are taking the string starting from index 2 (this is the third character) till the end. So it surely removes the first 2 characters.

            Max’s example will work like a charm for your problem. If in another case you always want to remove the last two characters. you could use

            Code:

            set output [string range $input 0 end-2]

            Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

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