question: how do you intend to use (String Date) -> (Date object) API.
The headers often have a format that does not comply with RFC822. 'Date'
header often does not comply. Part of the 'Recieved' header usu. does, but
that seems to be a practice not a standard(I think, can anyone confirm)
I want to extract information like 'Sent Date' and display via HTML pages.
Have had a few problems, but this combination has worked best. I try to
parse the date with each one.
--------------------------------
private static final DateFormat DF =
new SimpleDateFormat("EE, d MMM yyyy HH:mm:ss",Locale.US);
private static final DateFormat DF2 =
new SimpleDateFormat("d MMM yyyy HH:mm:ss",Locale.US);
private static final DateFormat DF3 =
new SimpleDateFormat("EE MMM d HH:mm:ss zzz yyyy",Locale.US);
--------------------
Wondering if anyone knows of an authoritative date field in the headers that
is most likely to comply with RFC822. At present I try this combination in
some order.
Another thing that worries/amuses/irritates me is that Format objects have
rarely exposed but existing multithreading issues. They are also slow.
Does anyone know of a faster and safer alternative ?
thanks,
Harmeet
P.S the CVS checkin
cvs commit: jakarta-james/src/java/org/apache/james/util RFC822Date.java
has this header 'Date: 3 Oct 2001 09:52:44 -0000'
This would not be parsed by <RFC822Date.dx>
:-(
----- Original Message -----
From: "Danny Angus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 03, 2001 3:05 AM
Subject: RFC822Date
> I've written new utility class org.apache.james.util.RFC822Date, which
> provides two-way conversion of java.util.Date into/out of RFC822 format.
> It also deals with timezones more comprehensively than RFC822DateFormat,
you
> can now specify a timezone other than you local one and convert RFC822
dates
> into other timezones.
> It has a wide selection of constructors for every contingency and choice o
f
> setters to allow setting by RFC string or Date object.
>
> The no args constructor produces a timestamp.
>
> I felt that it would be of more use to Mailet writers than
RFC822DateFormat,
> which only works one way, and only uses the default timezone.
>
> It should allow RFC822 date strings to be manipulated as simply as Date
> objects.
>
> I hope its some use to someone eventually!
> It is javadoc'ed.
>
> d.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]