Open
Description
Hi,
I've noticed that the default encoder for dates doesn't preserve the milliseconds precision
;; milliseconds are truncated
(json/write-value-as-string {:date (java.util.Date.)})
;;=> "{\"date\":\"2021-01-12T10:19:44Z\"}"
(json/write-value-as-string {:date (java.util.Date.)}
(json/object-mapper {:date-format "yyyy-MM-dd'T'HH:mm:ss.SSSX"}))
;;=> "{\"date\":\"2021-01-12T10:19:44.596Z\"}"
Is this a deliberate decision? wouldn't be better for the default encoder to preserve data as much as possible rather than truncating it?
Metadata
Assignees
Labels
No labels