From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/16875 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: date Date: 11 Sep 1998 14:56:21 +0900 Sender: owner-ding@hpc.uh.edu Message-ID: <28k93bqjju.fsf@kchisa.ga.sony.co.jp> References: <28n287qjtk.fsf@kchisa.ga.sony.co.jp> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: multipart/mixed; boundary="Multipart_Fri_Sep_11_14:56:21_1998-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035155676 30419 80.91.224.250 (20 Oct 2002 23:14:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:14:36 +0000 (UTC) Return-Path: Original-Received: from gizmo.hpc.uh.edu (gizmo.hpc.uh.edu [129.7.102.31]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id BAA08276 for ; Fri, 11 Sep 1998 01:56:00 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (sina.hpc.uh.edu [129.7.3.5]) by gizmo.hpc.uh.edu (8.7.6/8.7.3) with ESMTP id AAF08354; Fri, 11 Sep 1998 00:27:03 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 11 Sep 1998 00:54:31 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [209.195.19.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id AAA14427 for ; Fri, 11 Sep 1998 00:54:16 -0500 (CDT) Original-Received: from gatekeeper7.sony.co.jp (firewall-user@gatekeeper7.Sony.CO.JP [202.238.80.21]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id BAA08263 for ; Fri, 11 Sep 1998 01:54:05 -0400 (EDT) Original-Received: by gatekeeper7.sony.co.jp (3.6W-07/30/98) with ESMTP id OAA25721 for ; Fri, 11 Sep 1998 14:54:02 +0900 (JST) Original-Received: from shigw.shi.sony.co.jp by sonygw1.sony.co.jp (3.7W98090317) with SMTP id OAA07982 for ; Fri, 11 Sep 1998 14:57:15 +0900 (JST) Original-Received: from gagw.ga.sony.co.jp (gabrg [43.1.185.224]) by shigw.shi.sony.co.jp (8.6.12+2.4W/3.4W-97092516) with SMTP id OAA16832 for ; Fri, 11 Sep 1998 14:53:45 +0900 Original-Received: from kchisa.ga.sony.co.jp by gagw.ga.sony.co.jp (4.2/6.4J.6) id AA15459; Fri, 11 Sep 98 14:53:24 JST Original-To: ding@gnus.org In-Reply-To: Katsumi Yamaoka's message of "11 Sep 1998 14:50:31 +0900" Original-Lines: 84 User-Agent: Gnus/5.0700000000000003 (Pterodactyl Gnus v0.24) Emacs/19.34 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:16875 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:16875 --Multipart_Fri_Sep_11_14:56:21_1998-1 Content-Type: text/plain; charset=US-ASCII >>>>> In <28n287qjtk.fsf@kchisa.ga.sony.co.jp> >>>>> Katsumi Yamaoka wrote: KY> The last argument for encode-time() must be TZ. However, the last KY> element of list from parse-time-string() is nil. I wonder the number KY> of ellements from parse-time-string() exceeds right one by one. KY> And one another thing. When we calculate UT in article-make-date-line(), KY> only to input zero to TZ don't make the right value. By the way, there are some Emacsen, which depends on OS and have the BUG that TZ of the last argument is ignored by encode-time(). (current-time-string (encode-time 56 34 14 11 9 1998 32400)) "Fri Sep 11 14:34:56 1998" (current-time-string (encode-time 56 34 12 11 9 1998 0)) "Fri Sep 11 14:34:56 1998" <-- ??? I certified that they have the problem. Any Emacsen on NEWSOS4 Meadow 1.01 on Windows NT So I tried to make a program that replaces encode-time() to the function, which returnes correct value. --Multipart_Fri_Sep_11_14:56:21_1998-1 Content-Type: application/octet-stream; type=emacs-lisp Content-Disposition: attachment; filename="revised-encode-time.el" Content-Transfer-Encoding: 7bit (if (fboundp 'original-broken-encode-time) nil (if (equal (encode-time 0 0 0 1 1 2001 0) (encode-time 0 0 0 1 1 2001 43200)) (fset 'original-broken-encode-time (symbol-function 'encode-time)))) (defun revised-encode-time (&rest args) "Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time. This is the reverse operation of `decode-time', which see. ZONE defaults to the current time zone rule. This can be a string (as from `set-time-zone-rule'), or it can be a list \(as from `current-time-zone') or an integer (as from `decode-time') applied without consideration for daylight savings time. You can pass more than 7 arguments; then the first six arguments are used as SECOND through YEAR, and the *last* argument is used as ZONE. The intervening arguments are ignored. This feature lets (apply 'encode-time (decode-time ...)) work. Out-of-range values for SEC, MINUTE, HOUR, DAY, or MONTH are allowed; for example, a DAY of 0 means the day preceding the given month. Year numbers less than 100 are treated just like other year numbers. If you want them to stand for years in this century, you must do that yourself. " (let* ((len (length args)) (tz (if (> len 6) (nth (1- len) args))) (time (apply 'original-broken-encode-time args)) ms ls) (if (numberp tz) (progn (setq ms (car time) ls (- (car (cdr time)) tz)) (cond ((< ls 0) (list (1- ms) (+ ls 65536))) ((> ls 65535) (list (1+ ms) (- ls 65536))) (t (list ms ls)))) time))) (if (fboundp 'original-broken-encode-time) (fset 'encode-time 'revised-encode-time)) --Multipart_Fri_Sep_11_14:56:21_1998-1 Content-Type: text/plain; charset=US-ASCII -- Katsumi Yamaoka --Multipart_Fri_Sep_11_14:56:21_1998-1--