JDK-8282277 : Release Note: Additional Date-Time Formats
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • OS: generic
  • CPU: generic
  • Submitted: 2022-02-22
  • Updated: 2022-02-25
  • Resolved: 2022-02-25
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 19
19Resolved
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.