timezone incorrect about daylight saving time

Bug #1050854 reported by Fredrik Wendt
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Since one or two days back, Java doesn't recognize that I'm in a timezone with daylight saving time.

me@ubuntu:~$ mkdir /tmp/bug/
me@ubuntu:~$ cd /tmp/bug/
me@ubuntu:/tmp/bug$ cat >> Java.java
import java.util.*;

public class Java {
        public static void main(String... args) {
                System.out.println(new Date());
                System.out.println(TimeZone.getDefault());
        }
}
me@ubuntu:/tmp/bug$ javac Java.java

me@ubuntu:/tmp/bug$ LC_ALL=C date -u
Fri Sep 14 10:24:30 UTC 2012

me@ubuntu:/tmp/bug$ LC_ALL=C date -R
Fri, 14 Sep 2012 12:24:32 +0200

me@ubuntu:/tmp/bug$ java Java
Fri Sep 14 11:24:34 GMT+01:00 2012
sun.util.calendar.ZoneInfo[id="GMT+01:00",offset=3600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]

### the zoneinfo above should really say GMT+2 and dstSavings of one hour.

me@ubuntu:/tmp/bug$ javac -version
javac 1.6.0_24

me@ubuntu:/tmp/bug$ ls -l /etc/alternatives/javac
lrwxrwxrwx 1 root root 43 sep 14 11:51 /etc/alternatives/javac -> /usr/lib/jvm/java-6-openjdk-amd64/bin/javac

me@ubuntu:/tmp/bug$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.4) (6b24-1.11.4-1ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

me@ubuntu:/tmp/bug$ dpkg --list | grep tzdata
ii tzdata 2012e-0ubuntu0.12.04 time zone and daylight-saving time data
ii tzdata-java 2012e-0ubuntu0.12.04 time zone and daylight-saving time data for use by java runtimes

me@ubuntu:/tmp/bug$ dpkg --list | grep jdk
ii openjdk-6-jdk 6b24-1.11.4-1ubuntu0.12.04.1 OpenJDK Development Kit (JDK)
ii openjdk-6-jre 6b24-1.11.4-1ubuntu0.12.04.1 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-6-jre-headless 6b24-1.11.4-1ubuntu0.12.04.1 OpenJDK Java runtime, using Hotspot JIT (headless)
ii openjdk-6-jre-lib 6b24-1.11.4-1ubuntu0.12.04.1 OpenJDK Java runtime (architecture independent libraries)
ii openjdk-7-jdk 7u7-2.3.2-1ubuntu0.12.04.1 OpenJDK Development Kit (JDK)
ii openjdk-7-jre 7u7-2.3.2-1ubuntu0.12.04.1 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-7-jre-headless 7u7-2.3.2-1ubuntu0.12.04.1 OpenJDK Java runtime, using Hotspot JIT (headless)
ii openjdk-7-jre-lib 7u7-2.3.2-1ubuntu0.12.04.1 OpenJDK Java runtime (architecture independent libraries)

me@ubuntu:/tmp/bug$ md5sum /etc/localtime /usr/share/zoneinfo/Europe/Stockholm
1b9ed89af7331c6141249d181b42c621 /etc/localtime
1b9ed89af7331c6141249d181b42c621 /usr/share/zoneinfo/Europe/Stockholm

me@ubuntu:/tmp/bug$ env | egrep "(LANG|LC)" | sort
LANG=sv_SE.UTF-8
LANGUAGE=sv:en
LC_ADDRESS=sv_SE.UTF-8
LC_IDENTIFICATION=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_MONETARY=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_NUMERIC=sv_SE.UTF-8
LC_PAPER=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_TIME=sv_SE.UTF-8

Revision history for this message
Fredrik Wendt (fredrik-wendt) wrote :

I've tested this on my laptop with Ubuntu 11.10 and I get a different output from "java Java":
sun.util.calendar.ZoneInfo[id="Europe/Stockholm",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=119,lastRule=java.util.SimpleTimeZone[id=Europe/Stockholm,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]

md5sums are the same: md5sum /etc/localtime /usr/share/zoneinfo/Europe/Stockholm
1b9ed89af7331c6141249d181b42c621 /etc/localtime
1b9ed89af7331c6141249d181b42c621 /usr/share/zoneinfo/Europe/Stockholm

Revision history for this message
Fredrik Wendt (fredrik-wendt) wrote :

I solved this one by reinstalling tzdata and tzdata-java. No idea where things got wrong, but please close this report as not a bug. (It's not related to the JDK at least.)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-6 (Ubuntu):
status: New → Confirmed
Revision history for this message
Nils Fredrik Gjerull (nfg) wrote :

This happened to me too. Reinstallation of tzdata and tzdata-java fixed the problem. The Oracle JVM was not affected by this, only OpenJDK. Strange.

Revision history for this message
Vladimir Mokrozub (mogaba2009) wrote :

Had the same problem with OpenJDK 6b24 and Ubuntu Server 12.04 running as OpenVZ under Proxmox 1.9.
Reinstalling tzdata and tzdata-java fixed it.

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.