Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-article-time-format as a group parameter
@ 2002-08-15 10:34 Katsumi Yamaoka
  2002-08-15 12:12 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: Katsumi Yamaoka @ 2002-08-15 10:34 UTC (permalink / raw)


Hi,

The following code will make Gnus show Date headers in the
Japanese standard time for fj.* or japan.* newsgroups, otherwise
in the local time, even if a user lives in the outside of Japan.
However, it didn't work.  I've fixed it in CVS.

(setq gnus-treat-date-local 'head)

(setq gnus-parameters
      `(("\\`fj\\.\\|\\`japan\\."
	 (gnus-treat-date-local nil)
	 (gnus-treat-date-user-defined 'head)
	 (gnus-article-time-format
	  (lambda (time)
	    (let ((ms (car time))
		  (ls (car (cdr time))))
	      (if (>= (setq ls (+ ls ,(- 32400 ;; = +09.00 x 3600
					 (car (current-time-zone)))))
		      65536)
		  (setq ls (- ls 65536)
			ms (1+ ms)))
	      (format-time-string "Date: %a %b %d %T %Y +0900"
				  (list ms ls))))))))
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gnus-article-time-format as a group parameter
  2002-08-15 10:34 gnus-article-time-format as a group parameter Katsumi Yamaoka
@ 2002-08-15 12:12 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2002-08-15 12:12 UTC (permalink / raw)


Oops, I've mistaken in the last article.

>>>>> In <yotlu1lwz9zs.fsf@jpl.org>
>>>>>	Katsumi Yamaoka <yamaoka@jpl.org> wrote:

> The following code will make Gnus show Date headers in the
> Japanese standard time for fj.* or japan.* newsgroups, otherwise
> in the local time, even if a user lives in the outside of Japan.
> However, it didn't work.  I've fixed it in CVS.

Here's a correct one:

(setq gnus-treat-date-local 'head)

(setq gnus-parameters
      `(("\\`fj\\.\\|\\`japan\\."
	 (gnus-treat-date-local nil)
	 (gnus-treat-date-user-defined 'head)
	 (gnus-article-time-format
	  (lambda (time)
	    (let ((ms (car time))
		  (ls (car (cdr time))))
	      (setq ls (+ ls ,(- (* 9 3600)
				 (car (current-time-zone)))))
	      (cond ((>= ls 65536)
		     (setq ls (- ls 65536)
			   ms (1+ ms)))
		    ((< ls 0)
		     (setq ls (+ ls 65536)
			   ms (1- ms))))
	      (format-time-string "Date: %a %b %d %T %Y +0900"
				  (list ms ls))))))))
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-15 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-15 10:34 gnus-article-time-format as a group parameter Katsumi Yamaoka
2002-08-15 12:12 ` Katsumi Yamaoka

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).