Clock format difference between 5.8 and 6.1

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Clock format difference between 5.8 and 6.1

  • Creator
    Topic
  • #54863
    Richard Hart
    Participant

      We are migrating from 5.8 to 6.1 on RHEL.

      There appears to be an issue with the ‘%X’ for the clock format from hcitcl. Has anyone seen/fixed this?

      ie

      [5.8] he00387> hcitcl

      hcitcl>puts “[clock format [clock seconds] -format {%a %x %X}]”

      Wed 10/28/2015 03:42:05 PM

      [6.1] he00387> hcitcl

      hcitcl>puts “[clock format [clock seconds] -format {%a %x %X}]”

      Wed 10/28/2015 15:42:23

    Viewing 8 reply threads
    • Author
      Replies
      • #83244
        Charlie Bursell
        Participant

          Check that your locale did not change

          %X

          On output, produces the time of day in a locale-dependent representation. On input, accepts whatever %X produces and is used to determine time of day.

        • #83245
          Russ Ross
          Participant

            My hcitcl on AIX 6.1 and cloverleaf 6.0 produced what you showed for %X.

            If this helps changing it to %r gives lower case am/pm for my test seen below:

            Code:

            hcitcl>puts “[clock format [clock seconds] -format {%a %x %r}]”
            Wed 10/28/2015 10:58:15 am

            Of course another test in the afternoon would need to be done to be certain, but I will leave that up to you to confirm if interested.

            Russ Ross
            RussRoss318@gmail.com

          • #83246
            Richard Hart
            Participant

              Hi Guys.

              Thanks for the replies.

              Quote:

              Check that your locale did not change

              The 6.1 release was installed sometime ago and I am not aware of any changes to locale settimgs.

              The details above were completed by setting root (5.8/6.1), executing hcitcl and then the clock command.

              Quote:

              … changing it to %r gives lower case am/pm

              I’ll give it a go

              It’s a low priority issue at the moment, but I’ll post updates.

            • #83247
              Jeff Dinsmore
              Participant

                It looks like it may be a difference between Tcl 8.4 and 8.5.

                RHEL CL 5.6:

                Code:

                hcitcl>info patchlevel
                8.4.12
                hcitcl>clock format [clock seconds] -format {%a %x %X}
                Thu 10/29/2015 08:26:15 AM

                RHEL CL 6.1.1:

                Code:

                hcitcl>info patchlevel
                8.5.10
                hcitcl>clock format [clock seconds] -format {%a %x %X}
                Thu 10/29/2015 08:23:02

                I always just build my time strings out of specific components so I get exactly what I want.

                RHEL CL 5.6:

                Code:

                hcitcl>clock format [clock seconds] -format “%a %m/%d/%Y %H:%M:%S %p”
                Thu 10/29/2015 08:46:08 AM

                RHEL CL 6.1.1:

                Code:

                clock format [clock seconds] -format “%a %m/%d/%Y %H:%M:%S %p”
                Thu 10/29/2015 08:26:13 AM

                Jeff Dinsmore
                Chesapeake Regional Healthcare

              • #83248
                Richard Hart
                Participant

                  Thanks Jeff.

                  I get the same results you did with RHEL 5.8 with Cloverleaf 5.8 and 6.1.

                  problem solved.

                  I tried the %r option and this also produced inconsistent results.

                  Code:

                  [5.8] aise01t> hcitcl
                  hcitcl>puts “[clock format [clock seconds] -format {%a %x %X}]”
                  Fri 10/30/2015 09:13:31 AM
                  hcitcl>puts “[clock format [clock seconds] -format {%a %x %r}]”
                  Fri 10/30/2015 09:13:42 AM

                  [6.1] aise01t> hcitcl
                  hcitcl>puts “[clock format [clock seconds] -format {%a %x %X}]”
                  Fri 10/30/2015 09:13:54
                  hcitcl>puts “[clock format [clock seconds] -format {%a %x %r}]”
                  Fri 10/30/2015 09:13:59 am

                • #83249
                  Russ Ross
                  Participant

                    I previously did not understand you needed an identical solution that works for both the old and the new environment.

                    I thought you were just trying to get something working for the new environment and leave the old environment alone.

                    Try the more granular solution that Jeff posted previously, which I think has a good chance working on both the old environment and new environment:

                    Code:

                    hcitcl>clock format [clock seconds] -format “%a %m/%d/%Y %H:%M:%S %p”
                    Thu 10/29/2015 08:46:08 AM

                    Russ Ross
                    RussRoss318@gmail.com

                  • #83250
                    Charlie Bursell
                    Participant

                      FYI

                      I asked this question on the Tcl forum.  Many others tested it and came to the same conclusion.  It is a bug that happened somewhere between 8.4 and 8.5

                      I have been asked to create a ticket on it.  As soon as I figure out how, I will do that   😀

                    • #83251
                      Richard Hart
                      Participant

                        Thanks Charlie

                      • #83252
                        Charlie Bursell
                        Participant

                          Bug report has been submitted

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