i am using jdk1.1.5 and netscape 4.5, when i try to get the system Date it is working fine in appletviewer, but in netscape it shows date different. anyone can pl. How can i solve it?. are there any other way to do it?. cheers selvaraj G.
The problem is in the default TimeZone. I wrote the simple applet, that does System.out.println(new Date(System.currentTimeMillis())); I got the following results: hotjava: Thu Jan 14 19:07:19 GMT 1999 netscape: Thu Jan 14 11:09:28 PST 1999 appletviewer: Thu Jan 14 19:11:03 GMT 1999 iexplore: Thu Jan 14 11:21:21 PST 1999 The different in hours is the different between PST and GMT timezones. You can set default timezone via TimeZone.setDefault(), you just need to get the TimeZone instance for "GMT" id, and dates should be equal.
I have to say, that I failed on this. At least doing TimeZone.setDefault(TimeZone.getTimeZone("GMT")); didn't help, though GMT is one of available IDs. But I heard there are some bugs in TimeZone classes
With best of best regards, Pawel S. Veselov ( aka Black Angel )
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad: