DateDecodingStrategy
public enum DateDecodingStrategy
The strategy to use for decoding Date values.
-
Defer to
Datefor decoding. This is the default strategy.Declaration
Swift
case deferredToDate -
Decode the
Dateas a UNIX timestamp from a JSON number.Declaration
Swift
case secondsSince1970 -
Decode the
Dateas UNIX millisecond timestamp from a JSON number.Declaration
Swift
case millisecondsSince1970 -
Decode the
Dateas an ISO-8601-formatted string (in RFC 3339 format).Declaration
Swift
case iso8601 -
Decode the
Dateas a string parsed by the given formatter.Declaration
Swift
case formatted(DateFormatter) -
Decode the
Dateas a custom value decoded by the given closure.Declaration
Swift
case custom((_ decoder: Decoder) throws -> Date)
View on GitHub
DateDecodingStrategy Enumeration Reference