Skip to content
Tcl Source Code History Of Ticket 2207436
Login

History Of Ticket 2207436

Artifacts Associated With Ticket 2207436

  1. Ticket change [015f09fa38] (rid 119472) by nijtmans on 2008-10-29 14:22:00:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Since last sunday, our HP-UX system is
      showing the wrong time in all Tcl applications.
      Our timezone is MET-1METDST
      
      The reason is the "clock format" command:
      % clock format 1225288971 -timezone MET-1METDST
      Wed Oct 29 16:02:51 METDST 2008
      
      This is wrong: Summertime ended Oct 26, 2008,
      so the answer should be:
      
      % clock format 1225288971 -timezone MET-1METDST
      Wed Oct 29 15:02:51 MET 2008
      
      This problem is still present in the lastest CVS trunk
      
    4. foundin initialized to: "obsolete: 8.6a4"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "nijtmans"
    10. subsystem initialized to: "16. Commands A-H"
    11. title initialized to:
      clock format: wrong handling of MET-1METDST timezone
      
    12. type initialized to: "Bug"
  2. Ticket change [f88b604d0f] (rid 91559) by nijtmans on 2008-10-29 21:24:22:

    1. icomment:
      See:
      <http://en.wikipedia.org/wiki/European_Summer_Time>
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  3. Ticket change [5efa36c1bb] (rid 115731) by dkf on 2008-10-31 04:24:49:

    1. subsystem changed to: "06. Time Measurement"
  4. Ticket change [fdf6134e4d] (rid 108506) by kennykb on 2008-10-31 18:12:05:

    1. icomment:
      MET-1METDST doesn't specify the dates on which Summer Time
      begins and ends, and so defaults to US rules. A correct
      specifier for the time in the Netherlands would be
      
          :Europe/Amsterdam
      
      or
      
         <MET>-01:00:00<METDST>-02:00:00,M3.5.0/02:00:00,M10.5.0/01:00:00
      
      The first string might not work with other applications on
      HP-UX (I seem to recall that it doesn't have zoneinfo), but
      the second one should work with any Posix-compliant C library.
      
      Specifying just MET or CET as a timezone would also work, but
      is deprecated. It will certainly give the wrong transition
      times for dates before 1981 - prior to that, the EC didn't
      specify transition times and each nation went its own way.
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. resolution changed to: "Invalid"
    5. status changed to: "Closed"
    6. username: "kennykb"
  5. Ticket change [58e23ce75b] (rid 117876) by kennykb on 2008-10-31 18:12:06:

    1. closedate changed to: "2008-10-31T11:12:06"
    2. closer changed to: "kennykb"
  6. Ticket change [75de7c1c57] (rid 105466) by nijtmans on 2008-10-31 20:54:49:

    1. icomment:
      > MET-1METDST doesn't specify the dates on which Summer Time
      > begins and ends, and so defaults to US rules.
      
      Defaulting to US rules is a heuristic which makes it work
      for the US in recent enough dates. Why could the same
      heuristic not be implemented for Europe as well? It
      doesn't matter that it is incorrect for past dates,
      it currently is incorrect for current dates.
      
      I don't think that this is "invalid": We have a real
      problem, and other applications (using the HP-UX C
      library) work well with this timezone specification.
      I will try to create a fix for this. Are you willing
      to review it? (I am not so familiar with this code
      than you are)
      
      We have a workaround, that is setting TCL_TZ to
      :localtime. TZ is currently set to MET-1METDST,
      so this makes the C library do the correct
      translations. That's why other applications
      work fine. Introducing this workaround is more
      work than simply waiting two more days: then it
      will be fixed automatically (for now, it will
      come back every year).   :-(
      
      Anyway, I'll try to create a patch with
      testcases.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  7. Ticket change [831f44e88b] (rid 117342) by nijtmans on 2008-10-31 22:06:40:

    1. icomment:
      OK, here is a test case. If I change "-timezone MET-1METDST"
      to "-timezone :localtime" then the test passes, otherwise
      it fails.
      
      ============================================================
      test clock-52.2 {correct conversion of times in Europe} {
          # Jan Nijtmans reported [Bug 2207436] where DST rollover in
          # Europe was miscalculated using METDST.  The problem was
          # that in this case, the heuristic uses US DST rules in
          # stead of European DST rules
          set result {}
          foreach t {1206838799 1206838800 1224982799 1224982800} {
      lappend result [clock format $t -format %H:%M:%S \
          -timezone MET-1METDST]
          }
          set result
      } {01:59:59 03:00:00 02:59:59 02:00:00}
      
      
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  8. Ticket change [36f4e2e397] (rid 107190) by kennykb on 2008-11-01 05:32:48:

    1. icomment:
      A far better workaround would be to change the system timezone
      to <MET>-01:00:00<METDST>-02:00:00,M3.5.0/02:00:00,M10.5.0/01:00:00
      
      A simple MET-1METDST invokes "implementation-defined interpretation"
      in the Posix rules. In fact, on my Red Hat system, it defaults to
      *obsolete* US rules, correct for neither the EU nor the US.
      
      I'm really curious what specifically you propose for the patch.
      
      I suppose that it might work to have zones between London and
      Istanbul default to EU rules, but that seems a trifle fragile;
      plus, where do we stop? The next thing will be that a ZA user
      will complain that we don't detect *those* rules.
      
      Tying to the time zone name is equally fragile; looking for
      MET will work only until a German user sets MEZ-1MESZ or
      a French user sets HNEC-1HEEC.
      
      This also really has the feel of an HPUX-specific solution.
      Virtually any other modern Unix has zoneinfo, and localtime\
      (and TZ) will be set to :Europe/Amsterdam rather than 
      MET-1METDST.
      
      I'll be glad to revisit this if the patch makes sense.
      Reverting the bug to 'Open' until we get this sorted out.
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "kennykb"
  9. Add attachment "clock.patch" [65cdb68b30] (rid 102606) by nijtmans on 2008-12-01 18:14:30.

  10. Ticket change [42008f7b8d] (rid 116290) by nijtmans on 2008-12-01 18:14:30:

    1. icomment:
      
      
      File Added - 303583: clock.patch
      
      Here is the patch I developed for it, with test cases.
      With your permission, I would like to check this in
      in both trunk and Tcl 8.6 (but if you prefer to do it
      yourself, that's fine as well). This solves an immediate
      problems: In NXP, the default locale for all European
      mainland countries is MET-1METDST, and the current
      Tcl implementation means that all Tcl applications
      (which I'm promoting) display wrong time stamps in
      the log files during a few weeks each year. If
      this patch can be in Tcl 8.5.6 (expected in december),
      then HP (usually having a delay of 1 month) will have
      it's pachage in january, then I can convince NXP to
      upgrade to Tcl 8.5.6 before march 2009 when the
      problem will occur again. That's why I am urging
      this patch.
      
      The full solution would be to parse /usr/lib/tztab on
      HP-UX. I'm willing to implement that. But still, on
      system where this file is not available, a heuristic
      should simply not use US rules in European time zones.
      That's why I started with implementing this heuristic
      as a first step.
      
      For the full solution, there still is time enough to
      get it in Tcl 8.6, but at least this patch solves
      the immediate problem.
      
      The test cases 'prove' that this patch works fine
      for time zones 0 up to -12, so all time zones where
      the European Summer time rules apply.
      
      Regards,
                Jan Nijtmans
      File Added: clock.patch
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  11. Ticket change [9858e6b4d6] (rid 110586) by nijtmans on 2008-12-11 21:06:16:

    1. icomment:
      Checked in for Tcl 8.6b1, and backported for Tcl 8.5.6.
      
      Still, this only handles the case for recent dates,
      and other people possibly have remarks about the
      implementation, but I didn't want to be too late
      for those two Tcl versions, coming out soon. If a
      problem is found, there is still time to fix it,
      therefore leaving open.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  12. Ticket change [299d244023] (rid 88897) by nijtmans on 2008-12-11 21:06:17:

    1. resolution changed to: "Fixed"
  13. Ticket change [69b363c309] (rid 103296) by kennykb on 2008-12-11 22:29:20:

    1. icomment:
      Jan,
      
      Thanks for taking the lead on this; could I trouble you to update the man page as well?  Right now, it refers to the Posix documentation, which specifies that the default change time is 02:00 if no time is specified, but is silent on the effect of a missing change date. If we are going to invent things, we probably need to tell the users what we've done.
      
      The need to document the change was why I was waiting to commit. I'm swamped with work, Tcl and otherwise.
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. username: "kennykb"
  14. Ticket change [f94a17ea49] (rid 91681) by nijtmans on 2009-01-09 18:40:38:

    1. closedate changed to: "2009-01-09T11:40:38"
    2. closer changed to: "nijtmans"
    3. icomment:
      Documentation is updated in trunk since dec 12 '08
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "nijtmans"