I've noticed what feels like an inconsistency when it comes to parsing DateTimes using fromLocale
If I specify a pattern that contains optional fractional seconds and toLocale then fromLocale if using the same pattern, it fails to parse when the initial DateTime does not contain the fractional seconds.
In this case, specifying a pattern of
"YYYY-MM-DD'T'hh:mm:ss.FFFFFFFFFz"
to attempt to parse valid ISO8601 DateTimes (I'm aware of the fromIso method but have a technical limitation on how I can use it)
When the fractional seconds of the DateTime are zero, or not present it errors:
I appreciate it may not be necessarily how the locale methods were designed, but I would expect that a DateTime printed and reparsed with the same pattern to succeed.
Henry Tue 27 May
Hi All,
I've noticed what feels like an inconsistency when it comes to parsing
DateTimes
usingfromLocale
If I specify a pattern that contains optional fractional seconds and
toLocale
thenfromLocale
if using the same pattern, it fails to parse when the initialDateTime
does not contain the fractional seconds.In this case, specifying a pattern of
to attempt to parse valid ISO8601 DateTimes (I'm aware of the
fromIso
method but have a technical limitation on how I can use it)When the fractional seconds of the
DateTime
are zero, or not present it errors:I appreciate it may not be necessarily how the locale methods were designed, but I would expect that a DateTime printed and reparsed with the same pattern to succeed.