timestamp without time zone in version2.5.1

"GUANG WANG" <[email protected]> Fri, 23 Jun 2006 09:46:51 -0400
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Hi,

I installed the ver 2.5.1 on my box (redhat-release-3WS-7.4, python 2.4.3,
postgresql8.0.8).
For some reason, when I tried to read timestamp without time zone data,
it is processed as a GMC time + local time zone instead of a local time.

Is it supposed to be so?

--FROM postgres console:
test=# \d timestamptest;
             Table "public.timestamptest"
   Column    |            Type             | Modifiers
-------------+-----------------------------+-----------
withoutzone | timestamp without time zone |
withzone    | timestamp with time zone    |

test=# insert into timestamptest values (now(),now());
INSERT 408307324 1
test=# select * from timestamptest;
        withoutzone         |           withzone
----------------------------+-------------------------------
2006-06-22 17:57:08.280913 | 2006-06-22 17:57:08.280913-04
(1 row)

--FROM API:
>>>from pyPgSQL import PgSQL
>>>pgConn=PgSQL.connect(database='test',host='localhost',user='t',password='t')
>>>pgcursor=pgConn.cursor()
>>>pgcursor.execute("select withoutzone,withzone from timestamptest limit 
>>>1")
>>>res=pgcursor.fetchone()
>>>print "time(without timezone)=%s\ntime(with timezone)=%s." % 
>>>(res[0],res[1])
time(without timezone)=2006-06-22 13:57:08.28
time(with timezone)=2006-06-22 17:57:08.28.



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642