diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java index 0d0f2359c2f..670a81f3f5f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,17 +99,20 @@ public class WebFluxProperties { public static class Format { /** - * Date format to use, for example 'dd/MM/yyyy'. + * Date format to use, for example 'dd/MM/yyyy'. Used for formatting of + * java.util.Date and java.time.LocalDate. */ private String date; /** - * Time format to use, for example 'HH:mm:ss'. + * Time format to use, for example 'HH:mm:ss'. Used for formatting of java.time's + * LocalTime and OffsetTime. */ private String time; /** - * Date-time format to use, for example 'yyyy-MM-dd HH:mm:ss'. + * Date-time format to use, for example 'yyyy-MM-dd HH:mm:ss'. Used for formatting + * of java.time's LocalDateTime, OffsetDateTime, and ZonedDateTime. */ private String dateTime; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java index 9945241d3e4..b26a4a9fd81 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -385,17 +385,20 @@ public class WebMvcProperties { public static class Format { /** - * Date format to use, for example 'dd/MM/yyyy'. + * Date format to use, for example 'dd/MM/yyyy'. Used for formatting of + * java.util.Date and java.time.LocalDate. */ private String date; /** - * Time format to use, for example 'HH:mm:ss'. + * Time format to use, for example 'HH:mm:ss'. Used for formatting of java.time's + * LocalTime and OffsetTime. */ private String time; /** - * Date-time format to use, for example 'yyyy-MM-dd HH:mm:ss'. + * Date-time format to use, for example 'yyyy-MM-dd HH:mm:ss'. Used for formatting + * of java.time's LocalDateTime, OffsetDateTime, and ZonedDateTime. */ private String dateTime; diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/reactive.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/reactive.adoc index 6e5a2d1b60b..10e23355087 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/reactive.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/reactive.adoc @@ -56,16 +56,19 @@ Conversion can also be customized using the `spring.webflux.format.*` configurat When not configured, the following defaults are used: |=== -|Property |`DateTimeFormatter` +|Property |`DateTimeFormatter` |Formats |configprop:spring.webflux.format.date[] |`ofLocalizedDate(FormatStyle.SHORT)` +|`java.util.Date` and `java.time.LocalDate` |configprop:spring.webflux.format.time[] |`ofLocalizedTime(FormatStyle.SHORT)` +|java.time's `LocalTime` and `OffsetTime` |configprop:spring.webflux.format.date-time[] |`ofLocalizedDateTime(FormatStyle.SHORT)` +|java.time's `LocalDateTime`, `OffsetDateTime`, and `ZonedDateTime` |=== diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc index a69ca3f9067..0b63e82d3f1 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc @@ -65,16 +65,19 @@ Conversion can also be customized using the `spring.mvc.format.*` configuration When not configured, the following defaults are used: |=== -|Property |`DateTimeFormatter` +|Property |`DateTimeFormatter` |Formats |configprop:spring.mvc.format.date[] |`ofLocalizedDate(FormatStyle.SHORT)` +|`java.util.Date` and `java.time.LocalDate` |configprop:spring.mvc.format.time[] |`ofLocalizedTime(FormatStyle.SHORT)` +|java.time's `LocalTime` and `OffsetTime` |configprop:spring.mvc.format.date-time[] |`ofLocalizedDateTime(FormatStyle.SHORT)` +|java.time's `LocalDateTime`, `OffsetDateTime`, and `ZonedDateTime` |===