It is somewhat unexpected that a custom pattern of (e.g.) "HH" will work fine, but a custom pattern of "H" will throw an error (see e.g. #928), and needs to be specified as "%H" instead.
We do document this in the user guide (http://nodatime.org/userguide/text, "Standard and custom patterns"), but it's a bit hidden.
It would be nice if the exception text ("The standard format "x" is not valid for the NodaTime.ZonedDateTime type.") explicitly mentioned the possibility of escaping a custom pattern.
(Perhaps it could do so conditionally based on whether %x was a valid custom format pattern; doing that is trivial, apart from the case of InstantPatternParser.)
It is somewhat unexpected that a custom pattern of (e.g.)
"HH"will work fine, but a custom pattern of"H"will throw an error (see e.g. #928), and needs to be specified as"%H"instead.We do document this in the user guide (http://nodatime.org/userguide/text, "Standard and custom patterns"), but it's a bit hidden.
It would be nice if the exception text ("The standard format "x" is not valid for the NodaTime.ZonedDateTime type.") explicitly mentioned the possibility of escaping a custom pattern.
(Perhaps it could do so conditionally based on whether
%xwas a valid custom format pattern; doing that is trivial, apart from the case ofInstantPatternParser.)