SCM

[#1011335] TimestampTZ column returns Datetime not DatetimeOffset

View Trackers | Bugs | Download .csv | Monitor

Date:
2013-05-27 17:34
Priority:
3
State:
Open
Submitted by:
Francisco Figueiredo jr. (fxjr)
Assigned to:
Nobody (None)
Npgsql Version:
None
Category:
None
Group:
None
Resolution:
None
Summary:
TimestampTZ column returns Datetime not DatetimeOffset

Detailed description

From https://github.com/franciscojunior/Npgsql2/issues/11
github user: schotime

Hi,

I'm trying the following:

using (var conn = new Npgsql.NpgsqlConnection("Server=127.0.0.1;Database=test;User Id=;Password=;"))
using (var com = new NpgsqlCommand("select lastmodfied from passwords", conn))
{
conn.Open();
var reader = com.ExecuteReader();

while (reader.Read())
{
var date = (DateTimeOffset)reader.GetValue(0);
}
}
however its returning a DateTime. How do I get a DateTime Offset from a TimestampTZ?

Cheers,
Adam

Followup

Message
Date: 2014-08-07 21:30
Sender: Daniel Chaffee

Has this been addressed or does it plan to be addressed or is there a workaround? This is seriously problematic since it causes times to simply be off by potentially many hours

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge