Timestamp with milliseconds

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Timestamp with milliseconds

  • Creator
    Topic
  • #54671
    TorfinnK
    Participant

      Hello

      I understand that in tcl 8.5 (CL 6.1) I should be able to write a timestamp that also contains millisecond, something like: 2015-05-05 11:22:33.123.

      Can anyone help

      /Torfinn

    Viewing 1 reply thread
    • Author
      Replies
      • #82516
        David Barr
        Participant

          I think that TCL only supports milliseconds for measuring between two times. You would call “clock clicks -milliseconds”, then call it again and subtract the difference to get the elapsed time. I don’t think there’s a way to get the “clock format” command to include milliseconds.

        • #82517
          David Barr
          Participant

            I missed the “clock milliseconds” command. It looks like you can do this:

            Code:

            set m [clock milliseconds];
            set ms [format “%03d” [expr $m%1000]]
            set f [clock format [expr $m/1000] -format “%H:%M:%S.$ms”]
            puts $f

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