From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/9534 Path: main.gmane.org!not-for-mail From: visigoth@naiad.fac.cs.cmu.edu Newsgroups: gmane.emacs.gnus.general Subject: Re: Statistics'R'Us Date: 22 Jan 1997 03:00:18 -0500 Sender: visigoth@naiad.fac.cs.cmu.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.93) Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035149545 19067 80.91.224.250 (20 Oct 2002 21:32:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:32:25 +0000 (UTC) Return-Path: Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.8.4/8.8.4) with SMTP id AAA10738 for ; Wed, 22 Jan 1997 00:10:48 -0800 Original-Received: from naiad.fac.cs.cmu.edu (NAIAD.FAC.CS.CMU.EDU [128.2.191.173]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Wed, 22 Jan 1997 09:00:30 +0100 Original-To: ding@ifi.uio.no In-Reply-To: Lars Magne Ingebrigtsen's message of 22 Jan 1997 00:09:35 +0100 Original-Lines: 61 X-Mailer: Red Gnus v0.76/XEmacs 19.14 Source-Info: Sender is really visigoth@naiad.fac.cs.cmu.edu Xref: main.gmane.org gmane.emacs.gnus.general:9534 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:9534 Hmm. (nnmail-date-to-time "21 Jan 1997 14:00:00") => (13029 4656) (nnmail-date-to-time "21 Jan 1997 14:00:00 +0000") => (13028 52192) (nnmail-date-to-time "21 Jan 1997 13:00:00 -0100") => (13028 48692) (nnmail-date-to-time "21 Jan 1997 12:00:00 -0200") => (13028 45192) Hmm. Those numbers shouldn't be changing... But they are, and in increments of 3500... I wonder... (nnmail-date-to-time "21 Jan 1997 14:00:00 +0001") => (13028 52191) Oho! It looks like you are counting the timezone delta in SECONDS, and that's just not right. :) One moment... (nnmail-date-to-time "21 Jan 1997 13:00:00 -3600") => (13028 52192) Let's see if I can get you a fix: Lars Magne Ingebrigtsen writes: > (defun nnmail-date-to-time (date) > "Convert DATE into time." > (condition-case () > (let* ((d1 (timezone-parse-date date)) > (t1 (timezone-parse-time (aref d1 3))) ---insert < (tz (aref d1 4)) < (tzh (substr tz 0 2)) < (tzm (substr tz 2 4)) < (tzs (concat (+ (* 3600 tzh) (* 60 tzm)))) ---done >) > (apply 'encode-time > (mapcar (lambda (el) > (and el (string-to-number el))) > (list > (aref t1 2) (aref t1 1) (aref t1 0) > (aref d1 2) (aref d1 1) (aref d1 0) ---Replace the below > (aref d1 4))))) ---------------------- < tzs)))) ---done replacing > ;; If we get an error, then we just return a 0 time. > (error (list 0 0)))) > > What's wrong here? The above is correct, I believe, but probably not optimal. For one thing, I can't recall another way to turn a number into a string, and for another, I'm working around the mapcar by doing it. This is a nice bug to fix, BTW. :) It must result in some interesting date comparisons. John.