wrong hour displayed in java

Asked by turul69

Hi,

I use a Kubuntu 7.04 (Feisty).

If I execute the date command from the system shell i get the correct value:
Wed Jun 6 10:16:50 EEST 2007

But if I execute the following java code the time is not correct:
.....
Timestamp currTime = new Timestamp (System.currentTimeMillis());
System.out.println(currTime);

The result is: 2007-06-06 09:15:52.249 (-1 hour diff)

I use Sun Java 1.5.0_11 and my time zone is Bucharest/Europe.

How I can solve this?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
turul69
Solved:
Last query:
Last reply:
Revision history for this message
turul69 (miklos.keresztes) said :
#1

From a windows XP virtual machine, running inside ubuntu, the java code return the correct time.

Revision history for this message
Best turul69 (miklos.keresztes) said :
#2

I linked manually the file /usr/share/zoneinfo/Europe/Bucharest to /etc/localtime and this solved my problem.