Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8320431

LocalDateTime.parse("4714-11-24 00:00:00 BC") fails after CLDR 44.0 update

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 22
    • core-libs
    • b24
    • generic
    • generic

      This code:

      java.time.LocalDateTime.parse("4714-11-24 00:00:00 BC", java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss G", Locale.ROOT));

      fails to parse after JDK-8306116 (CLDR 44.0 update).

      Running the code in jshell before I get:

      $ ./jdk-22+23/bin/jshell
      | Welcome to JShell -- Version 22-beta
      | For an introduction type: /help intro

      jshell> java.time.LocalDateTime.parse("4714-11-24 00:00:00 BC", java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss G", Locale.ROOT));
      $1 ==> -4713-11-24T00:00

      jshell>

      After I get:

      bin/jshell
      | Welcome to JShell -- Version 22-internal
      | For an introduction type: /help intro

      jshell> java.time.LocalDateTime.parse("4714-11-24 00:00:00 BC", java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss G", Locale.ROOT));
      | Exception java.time.format.DateTimeParseException: Text '4714-11-24 00:00:00 BC' could not be parsed at index 20
      | at DateTimeFormatter.parseResolved0 (DateTimeFormatter.java:2108)
      | at DateTimeFormatter.parse (DateTimeFormatter.java:2010)
      | at LocalDateTime.parse (LocalDateTime.java:494)
      | at (#1:1)

      jshell>

            naoto Naoto Sato
            sgehwolf Severin Gehwolf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: