From 7f50a723a946a32621f80b378f9da2c20f25c6ef Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Sat, 16 Nov 2024 16:19:03 +0100 Subject: [PATCH] Fix typo --- Date-and-Time-Formatting-with-JDK-20-and-higher.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Date-and-Time-Formatting-with-JDK-20-and-higher.md b/Date-and-Time-Formatting-with-JDK-20-and-higher.md index 089dd8f..5447907 100644 --- a/Date-and-Time-Formatting-with-JDK-20-and-higher.md +++ b/Date-and-Time-Formatting-with-JDK-20-and-higher.md @@ -26,7 +26,7 @@ Note, however, that the aforementioned `COMPAT` mode has been removed in JDK 23. The Spring team recommends the use of ISO standardized formats for both parsing and formatting of date/time values whenever possible. For example, consider using a predefined `iso` pattern in Spring's `@DateTimeFormat` annotation (for example, `@DateTimeFormat(iso = ISO.DATE_TIME)`) or one of the `ISO_*` constants defined in `java.time.format.DateTimeFormatter` (such as `ISO_DATE_TIME`) for programmatic handling of JSR-310 `java.time` value types. -Another option is to always use date/time formatting patterns that you control. In other words, instead of relying on predefined locale-sensitive patterns such as `@DateTimeFormat(style = "-M")` or `java.time.format.FormatStyle.MEDIUM` to parse or format a time, define your own date/time pattern that parses and formats times the way you expect – for example, `"HH:mm a"` to handle US English times such as `3:30 PM`, with a standard space before the `a` and `PM`. +Another option is to always use date/time formatting patterns that you control. In other words, instead of relying on predefined locale-sensitive patterns such as `@DateTimeFormat(style = "-M")` or `java.time.format.FormatStyle.MEDIUM` to parse or format a time, define your own date/time pattern that parses and formats times the way you expect – for example, `"HH:mm a"` to handle US English times such as `3:30 PM`, with a standard space before the `AM` and `PM`. **Using an ISO standardized format or a concrete pattern that you control allows for reliable system-independent and locale-independent parsing and formatting of date/time values.** However, if that is not an option for your use case, consider one of the _lenient_ approaches outlined below.