DatabaseDateDecodingStrategy
DatabaseDateDecodingStrategy
specifies how FetchableRecord
types that also adopt the standard Decodable
protocol decode their Date
properties.
enum DatabaseDateDecodingStrategy
For example:
struct Player: FetchableRecord, Decodable {
static func databaseDateDecodingStrategy(for column: String) -> DatabaseDateDecodingStrategy {
.timeIntervalSince1970
}
var name: String
var registrationDate: Date // decoded from epoch timestamp
}