From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45177 Path: main.gmane.org!not-for-mail From: Andreas Fuchs Newsgroups: gmane.emacs.gnus.general Subject: Re: ISO date in attribution line Date: Sun, 09 Jun 2002 22:40:49 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed ; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: main.gmane.org 1023655358 9229 127.0.0.1 (9 Jun 2002 20:42:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 9 Jun 2002 20:42:38 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17H9WH-0002Ok-00 for ; Sun, 09 Jun 2002 22:42:37 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17H9VL-0007wH-00; Sun, 09 Jun 2002 15:41:39 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 09 Jun 2002 15:41:56 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id PAA14756 for ; Sun, 9 Jun 2002 15:41:44 -0500 (CDT) Original-Received: (qmail 21032 invoked by alias); 9 Jun 2002 20:41:21 -0000 Original-Received: (qmail 21027 invoked from network); 9 Jun 2002 20:41:21 -0000 Original-Received: from mail.ycn.com (212.88.160.3) by gnus.org with SMTP; 9 Jun 2002 20:41:21 -0000 Original-Received: from eris.void.at (mail@212-88-187-152.ADSL.ycn.com [212.88.187.152]) by mail.ycn.com (8.11.3/8.9.3/Debian 8.9.3-21) with ESMTP id g59Kj7008369 for ; Sun, 9 Jun 2002 22:45:07 +0200 Original-Received: from asf by eris.void.at with local (Exim 3.35 #1 (Debian)) id 17H9UX-0006YC-00 for ; Sun, 09 Jun 2002 22:40:49 +0200 Mail-Copies-To: never X-Url: http://asf.void.at/ Original-To: ding@gnus.org X-Attribution: asf X-Face: 3*3w/y?I6|`'CYW7F~m0]U1)L\|[x"?/V6^;s3FU#q|F'AL(3C?$eslHvAmR:KjT"&LZeqM 0wMS%HM` Mail-Followup-To: ding@gnus.org Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45177 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45177 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Today, Kai Gro=DFjohann wrote: > I get the feeling that doing format-time-string on the result of > parse-time-string would be enough. Anyone want to try this? > (defun sc-jk-normalize-date (date) > "..." > (let ((date (encode-time (parse-time-string date)))) > (format-time-string "..." date))) This would have to be written as "(apply 'encode-time (parse...", and then it will fail (integerp nil) because of tc's slightly braindead date format: "Sun, 9 Jun 2002". That's it, all seconds, minutes, etc removed From=20the time string. Don't know why. A slightly more readable version is this (but I guess the right thing is to fix tc's date behaviour, which will be hard because I've seen modules depend on it): ,---- | (defun sc-jk-normalize-date (date) | "Extract the date (day month year) from an RFC 822 message | and write it as year-month-day (ISO 8601)" | (let* ((date-list (cdr (cdr (cdr (parse-time-string date))))) | (day (pop date-list)) | (month (pop date-list)) | (year (car date-list))) | (and year month day=20 | (format "%d-%02d-%02d" year month day)))) `---- Have fun, =2D-=20 Andreas Fuchs, , asf@jabber.at, antifuchs --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9A71RucDAWATX9F8RApLyAKDWKbGa3S+MBnYKFd0W2TSj3PaPBACg5Jvo PpvuiJ/gF9+OH3287LjL2gc= =ewP0 -----END PGP SIGNATURE----- --=-=-=--