October 14 UTC does not exist in 1582

The following code shows this effect.

 

  @Test
  public void blog() throws java.text.ParseException {
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
    Date d = df.parse("1582-10-14T00:00:00+0000");
    System.out.println(df.format(d));
  }

 The result is 1582-10-24T00:00:00+0000 instead of 1582-10-14T00:00:00+0000. Java simply uses 24 for 14, which is really confusing.

你可能感兴趣的:(java,Blog)