From ff9d0fdfa984a8664fd68c1439d7c4d484caabab Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Mon, 21 Oct 2024 17:26:53 +0200 Subject: [PATCH] =?UTF-8?q?Document=20basics=20for=20@=E2=81=A0DateTimeFor?= =?UTF-8?q?mat=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Date-and-Time-Formatting-with-JDK-20-and-higher.md | 4 +++- 1 file changed, 3 insertions(+), 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 d83d4ce..91ae8ce 100644 --- a/Date-and-Time-Formatting-with-JDK-20-and-higher.md +++ b/Date-and-Time-Formatting-with-JDK-20-and-higher.md @@ -43,7 +43,9 @@ The following sections provide guidance on lenient parsing for `@DateTimeFormat` #### Lenient `@DateTimeFormat` Configuration -TODO +As mentioned previously in this document, the Spring team recommends the use of ISO standardized formats or concrete patterns for both parsing and formatting of date/time values whenever possible. For time values, this can be achieved via `@DateTimeFormat(iso = ISO.TIME)` (which uses the `HH:mm:ss.SSSXXX` pattern) or `@DateTimeFormat(pattern = "h:mm a")` (which uses the `h:mm a` pattern that is compatible with `java.text.DateFormat.SHORT` and Spring's `-S` style for parsing and formatting time values, prior to the changes introduced in CLDR 42). + +> **TODO** Document benefits of `fallbackPatterns` in `@DateTimeFormat`. #### Lenient `SimpleDateFormat` and `DateTimeFormatter` Configuration