java does not handle timezones correctly

Bug #463943 reported by Snowflake
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: tzdata

Ubuntu 9.10 Karmic

Date d = new Date() <-- should be current local time, but is an hour off

TO FIX :

/etc/localtime should be a **symlink** to (for example) /usr/share/zoneinfo/America/Los_Angeles
NOT a copy of the file

Thanks!

Revision history for this message
Snowflake (obsidianfoundry-snowflake) wrote :

Um, forgot to mention it is Java that is affected by this.

Revision history for this message
Jeff Payne (jeffkpayne) wrote :

The above mentioned fix worked for me too. Java now gets correct timezone info and time related tests pass.

Revision history for this message
Martin Pitt (pitti) wrote :

There were specific reaons to convert it from a symlink to a real file some releases ago (behaviour on upgrades, availability when /usr is not yet mounted, etc.), so we won't change this back. This should instead be fixed in Java?

affects: tzdata (Ubuntu) → openjdk-6 (Ubuntu)
Revision history for this message
Matthias Klose (doko) wrote :

there is no code that interprets the symlink.

 - first, /etc/timezone is checked
 - then, /etc/localtime is checked

I do see the correct results in lucid.

Maybe you have an outdated copy of /etc/timezone?
Can you recheck with current lucid?

Changed in openjdk-6 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.