DateEncodingStrategy
public enum DateEncodingStrategy
Defines available strategies when encoding Date instances.
-
Encodes by
encode(to:)on the date instance.Declaration
Swift
case deferredToDate -
Encodes an integer with the number of seconds since midnight UTC on January 1, 1970.
Declaration
Swift
case secondsSince1970 -
Encodes an integer with the number of milliseconds since midnight UTC on January 1, 1970.
Declaration
Swift
case millisecondsSince1970 -
Encodes the date with the provided
ISO8601DateFormatter.Declaration
Swift
case iso8601(ISO8601DateFormatter) -
Encodes the date with the provided
DateFormatter.Declaration
Swift
case formatted(DateFormatter) -
Delegates the encoding to the closure provided.
Declaration
Swift
case custom((Date, Encoder) throws -> Void)
DateEncodingStrategy Enumeration Reference