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

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

Postby bpipe » Mon 01 Apr 2013 12:41

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.
bpipe
 
Posts: 19
Joined: Mon 08 Oct 2012 12:14

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

Postby Shalex » Mon 01 Apr 2013 16:54

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.
Shalex
Devart Team
 
Posts: 7774
Joined: Thu 14 Aug 2008 12:44

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

Postby Shalex » Wed 03 Apr 2013 07:24

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.
Shalex
Devart Team
 
Posts: 7774
Joined: Thu 14 Aug 2008 12:44

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

Postby Shalex » Fri 05 Apr 2013 13:04

New version of dotConnect for PostgreSQL 6.6 is released!
It can be downloaded from http://www.devart.com/dotconnect/postgresql/download.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.
Shalex
Devart Team
 
Posts: 7774
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL