|
28 | 28 | * <p>Formatting applies to parsing a date/time object from a string as well as printing a
|
29 | 29 | * date/time object to a string.
|
30 | 30 | *
|
31 |
| - * <p>Supports formatting by style pattern, ISO date time pattern, or custom format pattern string. |
| 31 | + * <p>Supports formatting by style pattern, ISO date/time pattern, or custom format pattern string. |
32 | 32 | * Can be applied to {@link java.util.Date}, {@link java.util.Calendar}, {@link Long} (for
|
33 | 33 | * millisecond timestamps) as well as JSR-310 {@code java.time} value types.
|
34 | 34 | *
|
35 | 35 | * <p>For style-based formatting, set the {@link #style} attribute to the desired style pattern code.
|
36 | 36 | * The first character of the code is the date style, and the second character is the time style.
|
37 | 37 | * Specify a character of 'S' for short style, 'M' for medium, 'L' for long, and 'F' for full.
|
38 |
| - * The date or time may be omitted by specifying the style character '-' — for example, |
| 38 | + * The date or time may be omitted by specifying the style character '-'. For example, |
39 | 39 | * 'M-' specifies a medium format for the date with no time. The supported style pattern codes
|
40 | 40 | * correlate to the enum constants defined in {@link java.time.format.FormatStyle}.
|
41 | 41 | *
|
| 42 | + * <p><strong>WARNING</strong>: Style-based formatting and parsing rely on locale-sensitive |
| 43 | + * patterns which may change depending on the Java runtime. Specifically, applications that |
| 44 | + * rely on date/time parsing and formatting may encounter incompatible changes in behavior |
| 45 | + * when running on JDK 20 or higher. Using an ISO standardized format or a concrete pattern |
| 46 | + * that you control allows for reliable system-independent and locale-independent parsing and |
| 47 | + * formatting of date/time values. The use of {@linkplain #fallbackPatterns() fallback patterns} |
| 48 | + * can also help to address compatibility issues. For further details, see the |
| 49 | + * <a href="https://github.com/spring-projects/spring-framework/wiki/Date-and-Time-Formatting-with-JDK-20-and-higher"> |
| 50 | + * Date and Time Formatting with JDK 20 and higher</a> page in the Spring Framework wiki. |
| 51 | + * |
42 | 52 | * <p>For ISO-based formatting, set the {@link #iso} attribute to the desired {@link ISO} format,
|
43 | 53 | * such as {@link ISO#DATE}.
|
44 | 54 | *
|
|
0 commit comments