wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes painful java.util.Date bug Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "painful java.util.Date bug" Watch "painful java.util.Date bug" New topic

painful java.util.Date bug

aulo aasmaa

Joined: Aug 06, 2001
Posts: 15

returns me the GMT time, even though I am located in GMT+2.
If my desktop clock shows 8:58, then the previous statement prints out 6:58.
Now where does this bug hide?
Sunetra Saha
Ranch Hand

Joined: Feb 25, 2001
Posts: 77
I think you have to use the DateFormat class in java.text to format the date to your local time/date format.
Chad McGowan
Ranch Hand

Joined: May 10, 2001
Posts: 265
Make sure your locale is set correctly in your JVM. Use:
to see where the JVM thinks you are...
aulo aasmaa

Joined: Aug 06, 2001
Posts: 15
Tnx, I have all the system keys in front of me:

The system kept counting with GMT as long as I made the default locale to GMT+2. It works fine now and all dates are displayed correctly in my JTable.
Tnx to everybody!
I agree. Here's the link: http://aspose.com/file-tools
subject: painful java.util.Date bug
Similar Threads
How to convert Date.toString back to Date
how to convert unix stamp to date?
Iplanet showing system date + 5:30 hrs
problem while inserting date field in oracle data base
Null Pointer exception while reading the property file in WAS-5