DateDecodingStrategy
public enum DateDecodingStrategy
Enum representing the various strategies for decoding Date
s from BSON.
As per the BSON specification, the default strategy is to decode Date
s from BSON datetime objects.
See also
bsonspec.org-
Decode
Date
s stored as BSON datetimes (default).Declaration
Swift
case bsonDateTime
-
Decode
Date
s stored as numbers of seconds since January 1, 1970.Declaration
Swift
case millisecondsSince1970
-
Decode
Date
s stored as numbers of milliseconds since January 1, 1970.Declaration
Swift
case secondsSince1970
-
Decode
Date
s by deferring to their default decoding implementation.Declaration
Swift
case deferredToDate
-
Decode
Date
s stored as ISO8601 formatted strings.Declaration
Swift
case iso8601
-
Decode
Date
s stored as strings parsable by the given formatter.Declaration
Swift
case formatted(DateFormatter)
-
Decode
Date
s using the provided closure.Declaration
Swift
case custom((_ decoder: Decoder) throws -> Date)