JDK-8255971 : Release Note: Day Period Support Added to java.time Formats
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • OS: generic
  • CPU: generic
  • Submitted: 2020-11-05
  • Updated: 2022-05-31
  • Resolved: 2022-05-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16Resolved
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.