You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@DateTimeFormat(iso = ISO.DATE_TIME) should use optimized formatter for LocalDateTime [SPR-14958] #19525
It looks like the usage of DateTimeFormatter.ISO_DATE_TIME to format LocalDateTime instances is significantly slower than a usage of DateTimeFormatter.ISO_LOCAL_DATE_TIME (see this benchmark for details).
It would be cool if we could switch to that DateTimeFormatter in case a LocalDateTime instance is to be converted.
We've got specific checks for printing LocalDate / LocalTime / LocalDateTime now, automatically switching to ISO_LOCAL_DATE / ISO_LOCAL_TIME / {{ISO_LOCAL_DATE_TIME}... but just for printing, not for parsing, since the non-local variants turn out to leniently strip zone information in an input string whereas the local variants strictly reject those. Since there is only a performance benefit in printing anyway according to my tests, this compromise should be alright.
Activity
spring-projects-issues commentedon Nov 30, 2016
Juergen Hoeller commented
We've got specific checks for printing
LocalDate/LocalTime/LocalDateTimenow, automatically switching toISO_LOCAL_DATE/ISO_LOCAL_TIME/ {{ISO_LOCAL_DATE_TIME}... but just for printing, not for parsing, since the non-local variants turn out to leniently strip zone information in an input string whereas the local variants strictly reject those. Since there is only a performance benefit in printing anyway according to my tests, this compromise should be alright.