Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
Cc: ding@gnus.org
Subject: Re: Patch to handle invalid dates during expiry
Date: Tue, 22 Nov 2005 08:19:33 +0900	[thread overview]
Message-ID: <b4m8xvhvbay.fsf@jpl.org> (raw)
In-Reply-To: <874q679krr.fsf@1stein.org>

>>>>> In <874q679krr.fsf@1stein.org> Stefan Schimanski wrote:

> Attached is a patch to nnmail.el to fix "Invalid Date" errors when the
> expire code hits messages with date headers which cannot be parsed by
> date-to-time.

> -	 (date (date-to-time
> -		(or (message-fetch-field "date") (current-time-string))))
> +	 (date 
> +	  (condition-case err
> +		  (date-to-time
> +		   (or (message-fetch-field "date") (current-time-string)))
> +		(error (message "%s" (error-message-string err)) 
> +			   (date-to-time (current-time-string)))))

Fixed in the trunk and the v5-10 branch.  Thanks.

I realized another problem concerned with `current-time-string'.
In Japan (TZ=+0900), for instance, the value of

(date-to-time (current-time-string))

gains from the value of `(current-time)' for 9 hours.  It is
because the value of `current-time-string' has no TZ info.

(current-time-string)
"Tue Nov 22 08:19:18 2005"

(format-time-string "%a %b %d %T %Y" (date-to-time (current-time-string)))
"Tue Nov 22 17:19:18 2005"

It might make the date that of tomorrow (or yesterday).  So,
I've modified it so as to use `current-time' rather than
`current-time-string'.



      reply	other threads:[~2005-11-21 23:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-20 19:33 Stefan Schimanski
2005-11-21 23:19 ` Katsumi Yamaoka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4m8xvhvbay.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).