From: GUANG W. <sun...@ho...> - 2006-06-23 13:46:57
|
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. |