You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a postgresql database with a 'timestampz' field.
This field has dates before Christ (not infinite), like 0001-12-31 09:00:00+00 BC, but the CLR type DateTime does not support dates before Christ.
Therefore, I get an exception "System.InvalidCastException: "Out of the range of DateTime (year must be between 1 and 9999)"
Maybe need to add a cast to DateTime.MinValue and DateTime.MaxValue if date is out of range?
Activity
austindrenski commentedon Jul 16, 2019
@KondratenkoAndrey Take a look at Npgsql's NodaTime plugin which maps NodaTime CLR types to PostgreSQL types, allowing you to represent for the full range of PostgreSQL date and time values.
I'm going to close this issue for now, but please feel free to post back if you have further questions about date/time support in Npgsql.