Page 1 of 1
Reading timestamp: DateTime.Kind = DateTimeKind.Local?
Posted: Tue 22 May 2012 16:34
by Matthias3
Hello,
my application reads timestamp values using DbCommand.ExecuteReader. The returned DateTime values have Kind = DateTimeKind.Local. Is this intent? IMHO, this is not quite correct, as there is no timezone information in the database columns. All other providers I can think of (SQLClient, Oracle data provider, Npgsql...) set Kind to Unspecified.
Thanks!
P.S.: I see in the release notes that this behavior was changed in the most recent version (350). But why?
Re: Reading timestamp: DateTime.Kind = DateTimeKind.Local?
Posted: Fri 25 May 2012 07:13
by Matthias3
Are there any comments on this issue?
Changing this behavior in the provider is critical in my opinion. E.g. when the application code creates a DateTimeOffset from the read DateTime value, the DateTimeOffset value depends on the Kind of the DateTime value. Therefore, changing the behavior may break applications.
Thanks!
Re: Reading timestamp: DateTime.Kind = DateTimeKind.Local?
Posted: Fri 25 May 2012 15:06
by Shalex
We have reproduced the issue when Devart.Data.PostgreSql.PgSqlDataReader.GetDateTime method returns DateTime with DateTimeKind.Local when reading from the timestamp without time zone column. We will correct this behaviour: DateTimeKind.Local -> DateTimeKind.Unspecified.
Re: Reading timestamp: DateTime.Kind = DateTimeKind.Local?
Posted: Tue 29 May 2012 12:10
by Matthias3
Pleased to hear that.
Regards,
Matthias
Re: Reading timestamp: DateTime.Kind = DateTimeKind.Local?
Posted: Tue 29 May 2012 13:23
by Shalex
The bug with returning DateTime with DateTimeKind.Unspecified by PgSqlDataReader.GetDateTime method when reading from the timestamp without time zone column is fixed. We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.
Re: Reading timestamp: DateTime.Kind = DateTimeKind.Local?
Posted: Fri 08 Jun 2012 15:50
by Shalex
New build of dotConnect for PostgreSQL 6.0.17 is available for download!
It can be downloaded from
http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to
http://forums.devart.com/viewtopic.php?f=3&t=24292 .