Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
UTC DateTime #2669
After updating to the latest EF Core 3 and therefore Npgsql 4.0 I've started to have some issues - which might have been pre-existing or not.
Say I have a model:
After updating to version 4, I noticed the following in the
I've also noticed that although I save
What's the easiest solution for saving and retrieving UTC date times? What I need is to have it as
I've been reading here http://www.npgsql.org/doc/types/datetime.html but there's no code example and I don't really understand where I'm supposed to set
You can change your database column's type to
If you know you're always storing UTC values and want to have DateTime instances with Kind=UTC, you can set up value conversion to set the Kind manually. Another option is simply to ignore the type and treat DateTime with Kind=Unspecified as UTC.
Am closing as I don't see anything actionable on Npgsql's side, but we can continue discussing this (and eventually reopen if we decide that any change is appropriate).