Time showed wrong
Hi,
I use a Linux box. The system time is correct. When I use the following code I get a wrong result.
...
Timestamp currTime = new Timestamp (System.currentTimeMillis());
System.out.println(currTime);
...
The result is: 2007-06-0609:15:52.249 (-1 hour diff)
If I execute the date command from the system shell i get the correct value:
Wed Jun 610:16:50 EEST 2007
My system time zone is Bucharest/Europe.
How I can solve this?
Message was edited by:
mkeresztes
Hi the output is:sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
Hi,My java version is:java version "1.5.0_11"Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
Wait a minute; you should be GMT+3 by now, cause it's summer time. Your timezone setting in Java is wrong. It should be something like ... offset=7200000, dstSavings=3600000,useDaylight=true ...