From: Karsten H. <Kar...@gm...> - 2007-06-27 14:17:11
|
On Thu, Jun 21, 2007 at 02:46:32PM +1000, Kingsley wrote: > I'm using PyPgSQL against a table that has a 'timestamp' type > field. Under Linux I have no problems, but when results are > returned from the database under win32, they are shifted by +10 hours > (This is also happens to be my timezone.) I have not applied a > timezone to the timestamp-type field. Interestingly, they are > being stored correctly, just not retrieved properly. > > The times in the database are indeed stored in UTC, but PyPgSQL doesn't > know this ;) You may just be lucky to retrieve "proper" values under Linux. In any case you'll have to tell PG which timezone the client is running under or else the default server timezone is used to return timestamps in - which may happen to work with Linux but not Windows. So, use "set client timezone to ..." somewhere appropriate in your connection setup. Or else always retrieve timestamps with the "AT timezone" syntax. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 |