0

I'm using Entity Framework with PostgreSQL. I have a big problem when retrieving timestamp with timezone data.

The value in the database (timestampwithtimezone type) is 2021-06-17 15:00:00.567379+07 (hour: 15, timezone: +7)

My computer has timezone -2, when I use LINQ to entity, the result (DateTimeOffset C#) is "17/06/2021 6:00:00 AM -02:00" (hour is changed to 6 and timezone is -2).

I want to keep original timezone, it is important for me. Is there any config?

I installed some nugets:

  • Npgsql 5.0.3
  • EntityFramework6.Npgsql 6.4.3

This error is not appear when I use entity framework with SQL Server.

Thank you very much.

0 Answers0