"Unparseable date"

Bug #275654 reported by Ben Bucksch
2
Affects Status Importance Assigned to Milestone
OpenJDK
Invalid
Medium
openjdk-6 (Ubuntu)
Invalid
Low
Unassigned

Bug Description

import java.util.*;
DateFormat dp = new SimpleDateFormat("yyyyMMddHHmmss z");
Date start = dp.parse("20081001175000 CET");

returns "Unparseable date" on OpenJDK 6 on Ubuntu 8.04.1 server, but works with Sub Java 6 on Gentoo.

I suspect it doesn't understand the timezone "CET" and expects a numerical ("+0100" or "+0200", depending on summer / winter time)?

Revision history for this message
Ben Bucksch (benbucksch) wrote :

Works with sun-java6-jre: It works when I remove openjdk-6-jre-headless and use the Sun Java 6 in Ubuntu. So, this is clearly an openJDK problem.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

I don't see any such problem on hardy with openjdk. What is the version of openjdk you are using? Mine is 6b11-2ubuntu2 which is available in hardy-updates.

Here is how I used your sample code.
import java.util.*;
import java.text.*;

public class DateTest{
        public static void main (String args[]){
                DateFormat dp = new SimpleDateFormat("yyyyMMddHHmmss z");
                try {
                        Date start = dp.parse("20081001175000 CET");
                } catch (Exception e){
                        System.out.println(e);
                        e.printStackTrace();
                }
        }
}

Revision history for this message
In , Matthias Klose (doko) wrote :

import java.util.*;
DateFormat dp = new SimpleDateFormat("yyyyMMddHHmmss z");
Date start = dp.parse("20081001175000 CET");

returns "Unparseable date" on OpenJDK 6 on Ubuntu 8.04.1 server, but works with Sun Java 6 on Gentoo.

Revision history for this message
In , Matthias Klose (doko) wrote :

Created attachment 112
test case

Changed in openjdk-6:
importance: Undecided → Low
status: New → Triaged
Changed in openjdk:
status: Unknown → Confirmed
Revision history for this message
In , 0-naveed (0-naveed) wrote :

Works OK for me using java-1.6.0-openjdk-1.6.0.0-0.18.b09.fc9.x86_64 on Fedora. If I println start in your test case, I get the following text, with no exceptions:

Wed Oct 01 12:50:00 EDT 2008

Revision history for this message
In , Omajid (omajid) wrote :

Works for me with java-1.6.0-openjdk-1.6.0.0-0.23.b12.fc10.i386 (Icedtea 1.3) on Fedora.

Changed in openjdk:
status: Confirmed → Invalid
Revision history for this message
Jem (jem-mawson) wrote :

I also confirm no issues.

jem@fawkes:~/t$ cat DateTimeParseTest.java
import java.util.*;
import java.text.*;

public class DateTimeParseTest {
    public static void main(String a[]) throws Exception {
        DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss z");
        System.out.println(df.format(new Date()));
        System.out.println(df.format(df.parse("20081001175000 CET")));
    }
}

jem@fawkes:~$ java -version
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6) Runtime Environment (build 1.6.0_0-b12)
OpenJDK Client VM (build 1.6.0_0-b12, mixed mode, sharing)

jem@fawkes:~/t$ java DateTimeParseTest
20081029073120 EST
20081001185000 CEST

Revision history for this message
Matthias Klose (doko) wrote :

closing as invalid; nobody is able to reproduce this.

Changed in openjdk-6:
status: Triaged → Invalid
Changed in openjdk:
importance: Unknown → Medium
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.