> According to what I checked timezone on my unix
> machine is "Asia/Jerusalem". To what should I compare
> this timezone? To the time zone on the client
> machine?
> Our client is invoking EJB API through RMI...
Okay, he's sending you a java.util.Date or some subclass, right? And it's displaying differently on his side than on yours? If you can change the format of the display on both ends to include TZ, you'll most likely see that yours shows a TZ that's an hour different from his. Barring that get the administrator on the server side to tell you what TZ that box is set to, and check what the TZ on your side is set to.
Thanks for all the replies I got.
I thougth about different reason for the time mismatch. Our Client is working on HP java version "1.4.2.08". Backend is java version "1.4.2.11". I know that DST latest changes is supported from java version "1.4.2.11". The date that I am getting in the input is 1 Apr 2007. I read on the Sun site that applications running on an older JRE may report incorrect time from March 11, 2007 through April 2, 2007 and from October 29, 2007 through November 4, 2007.
What do you think - can it be the reason for the mismatch?
> applications running on an older JRE may report incorrect time from
> March 11, 2007 through April 2, 2007 and from October 29, 2007
> through November 4, 2007.
This specifically applies to North American time zones. Not to Asia/Jerusalem. (Although I understand that Israel's handling of time zones is even more chaotic.)
> > applications running on an older JRE may report
> incorrect time from
> > March 11, 2007 through April 2, 2007 and from
> October 29, 2007
> > through November 4, 2007.
>
> This specifically applies to North American time
> zones. Not to Asia/Jerusalem. (Although I understand
> that Israel's handling of time zones is even more
> chaotic.)
Good point.
@OP: Have you looked at what I suggested in reply 18?
> > applications running on an older JRE may report
> incorrect time from
> > March 11, 2007 through April 2, 2007 and from
> October 29, 2007
> > through November 4, 2007.
>
> This specifically applies to North American time
> zones. Not to Asia/Jerusalem. (Although I understand
> that Israel's handling of time zones is even more
> chaotic.)
Good point.
@OP: Have you looked at what I suggested in reply 18?
On the other hand, if the TZs there are chaotic, it might be that there have either been changes to the rules recently or refinements/bugfixes in the OS. (Was this two different verions of the same OS we're talking about? I've lost track.)
The best educated guess I can make is that the two versions have different DST rules. Perhaps the newer version corrected a bug in the older version, or perhaps, if the TZs are "chaotic" there as someone said, the rules changed around the release of 1.4.2.11, and that was the first version to have the new rules.
Is 1 Apr. 07 when DST kicks in?
You can do something like this:
In both the old version and the new version, run a little test program that creates a Calendar whose time is shortly before the DST transition, (say an hour before) and then add() a couple of hours to it. Observe what the new time is--number of hours apparently elapsed vs. number of hours you add()ed and TZ.
Do this for both the current TZ rules and the previous ones, if they changed recently.
To create the Calendar in the proper TZ, if it's not your default TZ, you'll want to use SimpleDateFormat, and then get its millis and make a Calendar from that.