-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Hey there! In my PostgreSQL database I have two types of dates in the same column:
2017-12-08 23:20:47.307779+01
2017-09-29 02:00:00+02
One looks like to have milliseconds while the other one doesn't. Trying to decode this table from the database results in: FluentError.decodingError: The data couldn’t be read because it isn’t in the correct format. (Accessory nested model)
I tried digging into the FluentQuery
codebase and I figured out that the following method returns nil:
override func date(from string: String) -> Date? {
if let result = super.date(from: string) {
return result
}
return OptionalFractionalSecondsDateFormatter.withoutSeconds.date(from: string)
}
It seems that it's trying to decode the date with the withoutSeconds
formatter and is failing. Do you know what's going on? Are you trying to decode the dates with both milliseconds and without to make sure it can be decoded correctly?
Thanks a lot!
Metadata
Metadata
Assignees
Labels
No labels