We have migrated from Npgsql 5 to version 8, and now query from the example below is returning time in UTC, whereas previously it returned local time. The SQL function Now itself returns "timestamp with timezone". I generally use the GetDateTime function to read time from tables as well. What am I doing wrong?
using (NpgsqlCommand cmd = new NpgsqlCommand("SELECT \"now\"()", conn))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read() == true)
{
now = dr.GetDateTime(0);
}
}
}
This was a comprehensive change in how timestamp are handled in Npgsql 6.0. See the release notes here, and especially the breaking changes section, which contains some mitigation instructions.