Read DateTimeOffset with the PostgreSQL TIMEZONE
See original GitHub issueWhen reading a NodaTime ZonedDateTime from a PostgreSQL timestamp with time zone
, we look at the PostgreSQL connection’s Timezone parameter and return a ZonedDateTime in that timezone - this mimics the general PostgreSQL behavior when not using Npgsql.
We did not implement this for non-NodaTime DateTimeOffset, because PostgreSQL timezones are in IANA format, but .NET did not support those up to now - but that’s been done: https://github.com/dotnet/runtime/pull/49412. This means we can now start returning DateTimeOffset in the appropriate timezone, instead of in ~UTC~ the machine’s configured timezone.
On the downside, this would be a breaking change; even more tricky, the IANA support is only going to be available in .NET 6.0, so this would possibly mean a behavioral change depending on which .NET is being used (or we throw NotSupported or something. We can discuss.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (11 by maintainers)
I’m adding this to the backlog for now, let’s think about it for 7.0 (at the very least, by that time we will have multiple TFMs supporting this API, so it should be less risky).
Dropping the support for the
DateTimeOffset
for .NET versions below 6.0 is a pretty huge breaking change IMO.