Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8247781 Day periods support
  3. JDK-8255971

Release Note: Day Period Support Added to java.time Formats

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      A new formatter pattern, letter 'B', and its supporting method have been added to `java.time.format.DateTimeFormatter/DateTimeFormatterBuilder` classes. The pattern and method translate `day periods` defined in Unicode Consortium's CLDR (https://unicode.org/reports/tr35/tr35-dates.html#dayPeriods). Applications can now express periods in a day, such as "in the morning" or "at night", not just am/pm. The following example demonstrates translating the day periods:
      ```
      DateTimeFormatter.ofPattern("B").format(LocalTime.now())
      ```
      This example produces day period text depending on the time of the day and locale.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: