Open
Description
23:59:00.000000000
is serialized as23:59
;23:59:01.000000000
is serialized as23:59:01
;23:59:01.100000000
is serialized as23:59:01.100
.
It looks like people value consistency over prettiness when it comes to values produced by serializers, and it's more straightforward to parse a value when all parts of the format are always there. See FasterXML/jackson-modules-java8#76.
Other links where people are confused/irritated even by the behavior of LocalTime.toString
in Java:
- https://stackoverflow.com/questions/49967139/java-datetimeformatter-fail-to-parse-time-string-when-seconds-and-milliseconds
- https://bugs.openjdk.org/browse/JDK-8193307
- https://stackoverflow.com/questions/62699157/zero-seconds-are-not-printed-in-spite-of-the-formatter-pattern-java-time
- https://stackoverflow.com/questions/50786482/java-8-localdatetime-dropping-00-seconds-value-when-parsing-date-string-value-wi
#333 is a similar issue.