home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / tcl / 2268 < prev    next >
Encoding:
Text File  |  1992-12-30  |  4.7 KB  |  137 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!markd
  3. From: markd@NeoSoft.com (Mark Diekhans)
  4. Subject: Patch to Extended Tcl convertclock command
  5. Organization: NeoSoft Communications Services -- (713) 684-5900
  6. Date: Wed, 30 Dec 1992 07:35:33 GMT
  7. Message-ID: <C02AFB.3ss@NeoSoft.com>
  8. Lines: 127
  9.  
  10.  
  11. Patch to Extended Tcl tclX6.4c or tclX6.5c.
  12.  
  13. This patch fixes a bug in the convertclock command were a date string without
  14. an explict timezone returns invalid results.
  15.  
  16. This will work on either tclX6.4c or tclX6.5c.  This is patch3 because patch2
  17. brought tclX6.4c up to tclX6.5c.
  18.  
  19. If you have any problems, please mail tcl-project@NeoSoft.com.
  20.  
  21.  
  22. *** /u/markd/tmp/tclX6.5c/src/tclXgetdate.y    Sat Dec 19 14:15:21 1992
  23. --- src/tclXgetdate.y    Tue Dec 29 22:50:23 1992
  24. ***************
  25. *** 18,24 ****
  26.    *     University of North Carolina at Chapel Hill
  27.    *     getdate.y    2.13    9/16/86
  28.    *-----------------------------------------------------------------------------
  29. !  * $Id: tclXgetdate.y,v 2.1 1992/11/20 04:37:02 markd Exp $
  30.    *-----------------------------------------------------------------------------
  31.    */
  32.   
  33. --- 18,24 ----
  34.    *     University of North Carolina at Chapel Hill
  35.    *     getdate.y    2.13    9/16/86
  36.    *-----------------------------------------------------------------------------
  37. !  * $Id: tclXgetdate.y,v 2.2 1992/12/30 06:49:39 markd Exp $
  38.    *-----------------------------------------------------------------------------
  39.    */
  40.   
  41. ***************
  42. *** 527,533 ****
  43.           dayLight = MAYBE;
  44.           hh = mm = ss = 0;
  45.           merid = 24;
  46. -         ourzone = zone;
  47.   
  48.           if (err = yyparse()) return (-1);
  49.   
  50. --- 527,532 ----
  51. ***************
  52. *** 535,542 ****
  53.           mcheck(zoneflag);
  54.           mcheck(dateflag);
  55.           mcheck(dayflag);
  56.           if (err) return (-1);
  57.           if (dateflag || timeflag || dayflag) {
  58.                   sdate = dateconv(month,day,year,hh,mm,ss,merid,ourzone,
  59.                                    dayLight);
  60. --- 534,548 ----
  61.           mcheck(zoneflag);
  62.           mcheck(dateflag);
  63.           mcheck(dayflag);
  64.           if (err) return (-1);
  65. +         /*
  66. +          * If timezone was not in strings, set it here.  yyparse nukes ourzone
  67. +          * if not specified, but not sure why.
  68. +          */
  69. +         if (!zoneflag)
  70. +             ourzone = zone;
  71.           if (dateflag || timeflag || dayflag) {
  72.                   sdate = dateconv(month,day,year,hh,mm,ss,merid,ourzone,
  73.                                    dayLight);
  74. *** /u/markd/tmp/tclX6.5c/src/patchlevel.h    Sat Dec 19 14:14:59 1992
  75. --- src/patchlevel.h    Tue Dec 29 22:51:50 1992
  76. ***************
  77. *** 1,2 ****
  78.   
  79. ! #define PATCHLEVEL 2
  80. --- 1,2 ----
  81.   
  82. ! #define PATCHLEVEL 3
  83. *** /u/markd/tmp/tclX6.5c/tests/clock.test    Sat Dec 19 14:14:46 1992
  84. --- tests/clock.test    Tue Dec 29 22:51:32 1992
  85. ***************
  86. *** 12,18 ****
  87.   # software for any purpose.  It is provided "as is" without express or
  88.   # implied warranty.
  89.   #------------------------------------------------------------------------------
  90. ! # $Id: clock.test,v 2.1 1992/11/07 20:36:55 markd Exp $
  91.   #------------------------------------------------------------------------------
  92.   #
  93.   
  94. --- 12,18 ----
  95.   # software for any purpose.  It is provided "as is" without express or
  96.   # implied warranty.
  97.   #------------------------------------------------------------------------------
  98. ! # $Id: clock.test,v 2.2 1992/12/30 06:50:35 markd Exp $
  99.   #------------------------------------------------------------------------------
  100.   #
  101.   
  102. ***************
  103. *** 67,69 ****
  104. --- 67,81 ----
  105.       fmtclock $clock {%b %d,%Y %H.%M GMT} GMT
  106.   } {Oct 23,1992 15.00 GMT}
  107.   
  108. + test clock-3.7 {convertclock tests} {
  109. +     # Test if local timezone works when not explicitly specified.
  110. +     set clock [getclock]
  111. +     set ourzone [fmtclock $clock %Z]
  112. +     set intime [fmtclock $clock {%a %h %d %T %Y}]
  113. +     set cnv1 [convertclock $intime]
  114. +     set cnv2 [convertclock "$intime $ourzone"]
  115. +     expr {$cnv1 == $cnv2}
  116. + } 1
  117. *** /u/markd/tmp/tclX6.5c/CHANGES    Sat Dec 19 14:16:11 1992
  118. --- CHANGES    Tue Dec 29 23:06:17 1992
  119. ***************
  120. *** 397,399 ****
  121. --- 397,405 ----
  122.   19 Dec 92: Extended Tcl 6.5c patch 2 released. Makes TclX6.4c-P1 compatible
  123.              with Tcl 6.5 and Tk 3.0.  Plus adds above fixes and features.
  124.   ===============================================================================
  125. + 29 Dec 92:
  126. +   o Fixed bug in convertclock command were a date string without an explict
  127. +     timezone returns invalid results.
  128. + ===============================================================================
  129. + 29 Dec 92: Extended Tcl 6.4c/6.5c patch3 released.
  130. + ===============================================================================
  131.