Search found 2 matches

by Boone
Thu 12 May 2011 21:39
Forum: Entity Framework support
Topic: Entity Framework and PostgreSQL timestamptz bug
Replies: 10
Views: 4643

The actual details of how PostgreSQL stores data is not the point, but the fact that a timestamp WITH a timezone was returned by the server, but the timezone was silently dropped by the client. Now you are no longer able to determine the true time in UTC with certainty.

In hindsight, using a simple timestamp column which stores straight UTC would have avoided these issues.

Assuming we aren't able to guarantee the server timezone, what is the most reliable way to handle this? Is there a good way to change the timezone setting for a session w/ Entity Framework?
by Boone
Tue 10 May 2011 19:19
Forum: Entity Framework support
Topic: Entity Framework and PostgreSQL timestamptz bug
Replies: 10
Views: 4643

Entity Framework and PostgreSQL timestamptz bug

We are using Entity Framework with dotConnect PostgreSQL but have run stuck when working with columns of type "timestamp with timezone."

When querying the data, the timezone offset is lost. The DateTime object's Kind parameter is set to "DateTimeKind.Unspecified" and the time is simply set in whatever timezone the server happened to return.

I believe this is a bug. When querying timestamptz columns, DateTimeKind should be set to either Local or Utc with the date converted as necessary from whatever timezone was returned by the server.