Npgsql.FSharp
Npgsql.FSharp copied to clipboard
`RowReader.dateTime` should return `DateTimeKind.Utc`
I think reader.dateTime should always return dates with DateTimeKind.Utc. Otherwise this leads to problems downstream as eg. Json serialization will not append 'Z' to the string which will then be considered local-time by browsers and prevent correct conversion to actual local time.
Alternatively an additional function dateTimeUtc could be added.
Workaround
type RowReader with
member this.dateTimeUtc(column: string) : DateTime =
DateTime.SpecifyKind(this.dateTime column, DateTimeKind.Utc)