Currently serialization is experimental. We will have one serialization assembly for each type of serialization we support which requires separate dependencies; if and when "stock" binary and XML serialization are supported, they will be included within the main Noda Time assembly.
Json.NET is supported within the NodaTime.Serialization.JsonNet
assembly and the namespace
of the same name.
An extension method of ConfigureForNodaTime
is provided on both JsonSerializer
and
JsonSerializerSettings
. Alternatively, the NodaConverters
type provides public static read-only fields
for individual converters. (All converters are immutable.)
Custom converters can be created easily from patterns using NodaPatternConverter
.
All default patterns use the invariant culture.
Instant
: an ISO-8601 pattern extended to handle fractional seconds: yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFF'Z'
LocalDate
: ISO-8601 date pattern: yyyy'-'MM'-'dd
LocalTime
: ISO-8601 time pattern, extended to handle fractional seconds: HH':'mm':'ss.FFFFFFF
LocalDateTime
: ISO-8601 date/time pattern with no time zone specifier, extended to handle fractional seconds: yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFF
Interval
: A compound object of the form { Start: xxx, End: yyy }
where xxx
and yyy
are represented however the serializer sees fit. (Typically using the default representation above.)Offset
: general pattern, e.g. +05
or -03:30
Period
: The round-trip period pattern; NodaConverters.NormalizingIsoPeriodConverter
provides a converter using the normalizing ISO-like patternDuration
: TBDZonedDateTime
: TBDDateTimeZone
: The ID, as a stringDateTimeZone
representation.