Page 1 of 1

IDataReader.GetValue() for TimeStampTZ returns DateTime instead of DateTimeOffset

Posted: Mon 01 Apr 2013 12:41
by bpipe
IDataReader.GetValue(int) for TimeStampTZ column returns DateTime instead of DateTimeOffset.

Though you can get the desired result with some "magic" hand written code, it is not possible to use your driver with NHibernate, which expects DateTimeOffset typed obj.

In any case, I think TimeStampTZ columns should return DateTimeOffset.

I guess this was done for backward compatibility, because when IDataReader was designed there were no DateTimeOffset, and that's why it doesn't provide GetDateTimeOffset(int) method, and old programs expect DateTime, but you could provide ConnectionString configuration parameter to tell driver to return DateTimeOffset for TimeStampTZ in worst case.

Re: IDataReader.GetValue() for TimeStampTZ returns DateTime instead of DateTimeOffset

Posted: Mon 01 Apr 2013 16:54
by Shalex
bpipe wrote:IDataReader.GetValue(int) for TimeStampTZ column returns DateTime instead of DateTimeOffset.
Thank you for the suggestion. We will post here when the TimeStampTZ -> DateTimeOffset mapping is implemented.

Re: IDataReader.GetValue() for TimeStampTZ returns DateTime instead of DateTimeOffset

Posted: Wed 03 Apr 2013 07:24
by Shalex
The 'AllowDateTimeOffset' connection string parameter for returning the TimeStampTZ database value like System.DateTimeOffset by PgSqlDataReader is implemented. We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.

Re: IDataReader.GetValue() for TimeStampTZ returns DateTime instead of DateTimeOffset

Posted: Fri 05 Apr 2013 13:04
by Shalex
New version of dotConnect for PostgreSQL 6.6 is released!
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=26317.