Behavior difference in java.text.DateFormat API between JDK 8 and 9

Andrew Guibert aguibert at us.ibm.com
Tue Apr 4 21:44:00 UTC 2017



Hi all,

My team has observed that the following code produces different output on
JDK 8 and 9:

import java.text.*;
import java.util.*;

DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT,
DateFormat.MEDIUM);
long time = System.currentTimeMillis();
Date date = new Date(time);
System.out.println(formatter.format(date));

Output is:
JDK 9 (b162):  4/4/17, 2:13:38 PM
JDK 8 (121):    4/4/17 2:14:16 PM

The only difference is that in JDK 9 there is a comma separating the date
and time, whereas in JDK 8 there is not.  I'm not signed up as a
contributor so I don't think I can open a bug in the OpenJDK bug tracking
system, so hopefully someone from the OpenJDK team can take care of this
one for me.

Thanks, Andy Guibert


More information about the jdk9-dev mailing list