OffsetDateTime::parse -> format question #470
-
Hi :) I have a question regarding parsing and formatting the OffsetDateTime. The test below shows the case where parse and then format is used using Rfc3339 format. The result string is 2013-10-07T04:23:19.12Z instead of 2013-10-07T04:23:19.120Z.
Using: /Krzysztof |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The |
Beta Was this translation helpful? Give feedback.
The
OffsetDateTime
struct doesn't know how many digits were parsed; formatting and parsing are two separate operations. When formatting, the fewest number of digits necessary is used. In this case that is two.