[Lionel Lindemann]
> * p1: On a non-English system, the date string sent by the
> RFC822DateFormat() method was in the system language, resulting in an
error
> in the SMTP Date field

In the code I have the diff seems to be
-df = new SimpleDateFormat("EE, d MMM yyyy HH:mm:ss",Locale.US);
+df = new SimpleDateFormat("EE, d MMM yyyy HH:mm:ss", Locale.ENGLISH);

Do you see the same diff between your Code and James Code ?
Both Local.US and Local.ENGLISH seem to have the same language 'en', not
sure why the bug goes away.

[Lionel Lindemann]
> * p2: On a NT/2000 system, the time was not taking into account daylight
> savings. I guess this was also a problem on other systems, but I couldn't
> check.
>
> Attached is a modification proposition to the code, which aims to clear
> those two problems. I am not an expert in Java, nor in the James
> architecture, so please do check it carefully.

The Diff is.
-int min = TimeZone.getDefault().getRawOffset() / 1000 / 60;
+// p2: Used ZONE_OFFSET + DST_OFFSET instead of getRawOffset() to take into
account daylight savings
+GregorianCalendar rightNow = new GregorianCalendar();
+int min = (rightNow.get(rightNow.ZONE_OFFSET) +
rightNow.get(rightNow.DST_OFFSET)) / 1000 / 60;

As per the API <getRawOffset> does not account for timezone. Seems to be a
good fix to me. One nitpick though. The <min> calculation seems to be static
in nature. Do you think it would be a correct and better thing to move
calculation of <min> and the offset sting calculation to a  static
constructor ?

Harmeet


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to