-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Description
Looking at the code of LocalTime
, it seems that it explicitly allows only milliseconds as sub-second resolution. It is unclear (at least, to me) why this is the case. It seems unintuitive because both LocalDateTime
as well as DateTime
allow arbitrary precision for the sub-second part.1
I would like to suggest lifting this limitation in LocalTime
to bring it closer to LocalDateTime
and DateTime
.
This has come up in graphql-rust/juniper#1270 (comment) where serialization of the most common Rust time libraries is restricted to millisecond resolution despite all of them supporting nanosecond resolution internally.
Unfortunately, this could be considered a breaking change because it places the burden of parsing sub-millisecond resolution on downstream consumers.2
Footnotes
-
Despite neither the documentation of LocalDateTime nor DateTime indicating so. ↩
-
Although I would argue that most parsers should be able to handle the introduction of additional digits without any significant changes. ↩