Gnus development mailing list
 help / color / mirror / Atom feed
* Bug: Y2K?!
@ 1999-09-10 20:33 Shenghuo ZHU
  0 siblings, 0 replies; only message in thread
From: Shenghuo ZHU @ 1999-09-10 20:33 UTC (permalink / raw)
  Cc: Lars Magne Ingebrigtsen

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]


(article-make-date-line "Sat Jan 1 00:00:00 2000 -0400" 'local)
=> "Date: Fri Dec 31 23:00:00 1999 --400"

(article-make-date-line "Sat Jan 1 00:00:00 2000 UT" 'ut)
=> "Date: Fri Dec 31 23:00:00 1999 UT"

This only happens in daylight saving area. The attached patch fix the
bug.

Shenghuo

1999-09-10  Shenghuo ZHU  <zsh@cs.rochester.edu>

	* gnus-art.el (article-make-date-line): Fix time-zone bug.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 96-zsh6.diff --]
[-- Type: text/x-patch, Size: 975 bytes --]

--- ../../pgnus-sent/lisp/gnus-art.el	Fri Sep 10 10:53:06 1999
+++ gnus-art.el	Fri Sep 10 16:12:41 1999
@@ -1870,9 +1870,10 @@
      ;; functions since they aren't particularly resistant to
      ;; buggy dates.
      ((eq type 'local)
-      (let ((tz (car (current-time-zone))))
+      (let ((tz (car (current-time-zone time))))
 	(format "Date: %s %s%02d%02d" (current-time-string time)
-		(if (> tz 0) "+" "-") (/ tz 3600) (/ (% tz 3600) 60))))
+		(if (> tz 0) "+" "-") (/ (abs tz) 3600) 
+		(/ (% (abs tz) 3600) 60))))
      ;; Convert to Universal Time.
      ((eq type 'ut)
       (concat "Date: "
@@ -1880,7 +1881,7 @@
 	       (let* ((e (parse-time-string date))
 		     (tm (apply 'encode-time e))
 		     (ms (car tm))
-		     (ls (- (cadr tm) (car (current-time-zone)))))
+		     (ls (- (cadr tm) (car (current-time-zone time)))))
 		 (cond ((< ls 0) (list (1- ms) (+ ls 65536)))
 		       ((> ls 65535) (list (1+ ms) (- ls 65536)))
 		       (t (list ms ls)))))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-09-10 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-10 20:33 Bug: Y2K?! Shenghuo ZHU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).