EnumerationFoundation5.9.0
DateDecodingStrategy
The strategy to use for decoding Date
values.
enum DateDecodingStrategy
Citizens in Foundation
Members
case custom((Decoder) throws -> Date)
Decode the
Date
as a custom value decoded by the given closure.case deferredToDate
Defer to
Date
for decoding. This is the default strategy.case formatted(DateFormatter)
Decode the
Date
as a string parsed by the given formatter.case iso8601
Decode the
Date
as an ISO-8601-formatted string (in RFC 3339 format).case millisecondsSince1970
Decode the
Date
as UNIX millisecond timestamp from a JSON number.case secondsSince1970
Decode the
Date
as a UNIX timestamp from a JSON number.