UNIX time

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
andopo
Posts: 3
Joined: Tue 09 Jan 2007 11:47

UNIX time

Post by andopo » Tue 13 Feb 2007 11:42

Hi,
I have one field which contains UNIX time values, I try to create a datasource with such query:
SELECT to_timestamp((test.date_unix)::double precision) FROM test
I always get date: 2000-01-01 00:00:00

What is wrong?

Andrzej

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 14 Feb 2007 12:59

What is the version of your PostgreSQL server?
Please send me (alexeyi at crlab dot com) the dump of your test table.

andopo
Posts: 3
Joined: Tue 09 Jan 2007 11:47

global problem - timestamp

Post by andopo » Wed 14 Feb 2007 14:29

Hi,
I've noticed that the problem is with all timestamp fields. PostgreSQL version is 8.1.2 64 bit (also tested on 8.2.3 32 bit)

Test table DDL:
CREATE TABLE "public"."test" (
"id_test" SERIAL,
"date1" TIMESTAMP WITHOUT TIME ZONE,
"date2" DATE,
"date3" TIMESTAMP WITH TIME ZONE,
"godzina1" TIME WITHOUT TIME ZONE,
CONSTRAINT "test_pkey" PRIMARY KEY("id_test")
) WITHOUT OIDS;

All timestamp fields values are displayed wrong.

Funny thing is that when I test this test table on Windows everything is ok, under Linux (Suse 10.2) I got bad values.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 15 Feb 2007 09:31

We will investigate this. Look forward to the results.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 19 Feb 2007 14:53

Try to set Protocol=2 in your connection string.

Post Reply