Forums Register Login

Vista OS java.util.Date class is showing GMT time rather then local time.

+Pie Number of slices to send: Send
Hi Guys,

I am using java.util.Date class in java program to get local time (System time) however it's showing me GMT time.

I was using this code.

JLabel jl = new JLabel();
java.util.Date d = new java.util.Date();
java.text.SimpleDateFormat f =new java.text.SimpleDateFormat("HH:mm:ss");
jl.setText(f.format(d));

Thanks in Advance
+Pie Number of slices to send: Send
It may be related to this bug.
+Pie Number of slices to send: Send
So, which version of Java are you using exactly? The bug that Christophe mentioned was fixed in Sun Java 5 update 10, according to the bug report. Java 5 is already at update 18 at the moment. See if you can update to a newer version. (Ofcourse it would be even better if you could upgrade to Java 6).
+Pie Number of slices to send: Send
hey Jesper Young, Christophe

I am So grateful to you sir for your solution. I tried running the same application on version jdk1.6. It is working fine sir.

I highly appreciate you quick response in this regards.


Regards
Mannu Shukla
Uh oh, we're definitely being carded. Here, show him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 851 times.
Similar Threads
Vista OS java.util.Date class is showing GMT time rather then local time.
time zones
How o Display dateformat
epoch is wrong
date fomatting question from long
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:26:11.