james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Angus" <da...@thought.co.uk>
Subject Daylight saving bug
Date Wed, 19 Sep 2001 14:26:32 GMT
I've looked over the daylight saving time issue, I found myself having the
same error, and it seems to result from servers using daylight saving time,
I thought it might result from servers *not* using daylight saving, but a
raw GMT offset.

Anyway when I set my server up to use BST (not GMT+0) I got :

220 linux.killerbees.co.uk SMTP Server (JAMES SMTP Server 1.3-dev) ready
Wed, 19 Sep 2001 15:01:58 +0000

from the smtp login
I expected:
220 linux.killerbees.co.uk SMTP Server (JAMES SMTP Server 1.3-dev) ready
Wed, 19 Sep 2001 15:01:58 +0100

So I looked and found that ..
org.apache.james.util.RFC822DateFormat java.util.timeZone.getRawOffset() is
used to get the timezone offset, but this *doesn't* return an offset
containing the daylight savings adjustment..

So I've modified it, it seems to work for me so I've append the diff below,
what this does is add 1hr if daylight saving is used, and in force now.

Index: RFC822DateFormat.java
===================================================================
RCS file:
/home/cvspublic/jakarta-james/src/java/org/apache/james/util/RFC822DateForma
t.java,v
retrieving revision 1.1
diff -r1.1 RFC822DateFormat.java
48a49,52
>
>
if((TimeZone.getDefault().useDaylightTime())&&(TimeZone.getDefault().inDayli
ghtTime(new Date()))){
>             min +=60;
>         }


attached is the whole source file.

danny.

Mime
View raw message