DateEncoding
public enum DateEncoding
Encoding to use for Date
values.
-
Defers encoding to the
Date
type. This is the default encoding.Declaration
Swift
case deferredToDate
-
Encodes
Date
s as seconds since midnight UTC on January 1, 1970.Declaration
Swift
case secondsSince1970
-
Encodes
Date
s as milliseconds since midnight UTC on January 1, 1970.Declaration
Swift
case millisecondsSince1970
-
Encodes
Date
s according to the ISO8601 and RFC3339 standards.Declaration
Swift
case iso8601
-
Encodes
Date
s using the givenDateFormatter
.Declaration
Swift
case formatted(DateFormatter)
-
Encodes
Date
s using the given closure.Declaration
Swift
case custom((Date) throws -> String)