From: markd@NeoSoft.com (Mark Diekhans)
Subject: Patch to Extended Tcl convertclock command
Organization: NeoSoft Communications Services -- (713) 684-5900
Date: Wed, 30 Dec 1992 07:35:33 GMT


Patch to Extended Tcl tclX6.4c or tclX6.5c.

This patch fixes a bug in the convertclock command were a date string without
an explict timezone returns invalid results.

This will work on either tclX6.4c or tclX6.5c.  This is patch3 because patch2
brought tclX6.4c up to tclX6.5c.

If you have any problems, please mail tcl-project@NeoSoft.com.


*** /u/markd/tmp/tclX6.5c/src/tclXgetdate.y	Sat Dec 19 14:15:21 1992
--- src/tclXgetdate.y	Tue Dec 29 22:50:23 1992
***************
*** 18,24 ****
   *     University of North Carolina at Chapel Hill
   *     getdate.y    2.13    9/16/86
   *-----------------------------------------------------------------------------
!  * $Id: tclXgetdate.y,v 2.1 1992/11/20 04:37:02 markd Exp $
   *-----------------------------------------------------------------------------
   */
  
--- 18,24 ----
   *     University of North Carolina at Chapel Hill
   *     getdate.y    2.13    9/16/86
   *-----------------------------------------------------------------------------
!  * $Id: tclXgetdate.y,v 2.2 1992/12/30 06:49:39 markd Exp $
   *-----------------------------------------------------------------------------
   */
  
***************
*** 527,533 ****
          dayLight = MAYBE;
          hh = mm = ss = 0;
          merid = 24;
-         ourzone = zone;
  
          if (err = yyparse()) return (-1);
  
--- 527,532 ----
***************
*** 535,542 ****
          mcheck(zoneflag);
          mcheck(dateflag);
          mcheck(dayflag);
- 
          if (err) return (-1);
          if (dateflag || timeflag || dayflag) {
                  sdate = dateconv(month,day,year,hh,mm,ss,merid,ourzone,
                                   dayLight);
--- 534,548 ----
          mcheck(zoneflag);
          mcheck(dateflag);
          mcheck(dayflag);
          if (err) return (-1);
+ 
+         /*
+          * If timezone was not in strings, set it here.  yyparse nukes ourzone
+          * if not specified, but not sure why.
+          */
+         if (!zoneflag)
+             ourzone = zone;
+ 
          if (dateflag || timeflag || dayflag) {
                  sdate = dateconv(month,day,year,hh,mm,ss,merid,ourzone,
                                   dayLight);
*** /u/markd/tmp/tclX6.5c/src/patchlevel.h	Sat Dec 19 14:14:59 1992
--- src/patchlevel.h	Tue Dec 29 22:51:50 1992
***************
*** 1,2 ****
  
! #define PATCHLEVEL 2
--- 1,2 ----
  
! #define PATCHLEVEL 3
*** /u/markd/tmp/tclX6.5c/tests/clock.test	Sat Dec 19 14:14:46 1992
--- tests/clock.test	Tue Dec 29 22:51:32 1992
***************
*** 12,18 ****
  # software for any purpose.  It is provided "as is" without express or
  # implied warranty.
  #------------------------------------------------------------------------------
! # $Id: clock.test,v 2.1 1992/11/07 20:36:55 markd Exp $
  #------------------------------------------------------------------------------
  #
  
--- 12,18 ----
  # software for any purpose.  It is provided "as is" without express or
  # implied warranty.
  #------------------------------------------------------------------------------
! # $Id: clock.test,v 2.2 1992/12/30 06:50:35 markd Exp $
  #------------------------------------------------------------------------------
  #
  
***************
*** 67,69 ****
--- 67,81 ----
      fmtclock $clock {%b %d,%Y %H.%M GMT} GMT
  } {Oct 23,1992 15.00 GMT}
  
+ 
+ test clock-3.7 {convertclock tests} {
+     # Test if local timezone works when not explicitly specified.
+ 
+     set clock [getclock]
+     set ourzone [fmtclock $clock %Z]
+     set intime [fmtclock $clock {%a %h %d %T %Y}]
+ 
+     set cnv1 [convertclock $intime]
+     set cnv2 [convertclock "$intime $ourzone"]
+     expr {$cnv1 == $cnv2}
+ } 1
*** /u/markd/tmp/tclX6.5c/CHANGES	Sat Dec 19 14:16:11 1992
--- CHANGES	Tue Dec 29 23:06:17 1992
***************
*** 397,399 ****
--- 397,405 ----
  19 Dec 92: Extended Tcl 6.5c patch 2 released. Makes TclX6.4c-P1 compatible
             with Tcl 6.5 and Tk 3.0.  Plus adds above fixes and features.
  ===============================================================================
+ 29 Dec 92:
+   o Fixed bug in convertclock command were a date string without an explict
+     timezone returns invalid results.
+ ===============================================================================
+ 29 Dec 92: Extended Tcl 6.4c/6.5c patch3 released.
+ ===============================================================================
Newsgroups: comp.lang.tcl