Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8176706 Additional Date-Time Formats
  3. JDK-8282277

Release Note: Additional Date-Time Formats

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Additional date/time formats are now introduced in `java.time.format.DateTimeFormatter/DateTimeFormatterBuilder` classes. In prior releases, only 4 predefined styles, i.e., `FormatStyle.FULL/LONG/MEDIUM/SHORT` are available. Now the users can specify their own flexible style with this new `DateTimeFormatter.ofLocalizedPattern(String requestedTemplate)` method. For example,
      ```
      DateTimeFormatter.ofLocalizedPattern("yMMM")
      ```
      produces a formatter, which can format a date in a localized manner, such as "Feb 2022" in the `US` locale, while "2022年2月" in the Japanese locale. Supporting method `DateTimeFormatterBuilder.appendLocalized(String requestedTemplate)`is also provided.

        Attachments

          Activity

            People

            Assignee:
            naoto Naoto Sato
            Reporter:
            naoto Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: