Kingsley Turner | 12 Jan 2011 23:56
Favicon

mxDateTime on pyPgSQL/PostgreSQL applies timezone?

Hi,

I'm confused as to what's going on with a PostgreSQL "timestamp" type converted back to string.  The field in question is a "timestamp without time zone".

Selecting my timestamp from PostgreSQL via psql gives:

2011-01-12 21:54:11

Yet in my code, when I str() or mx.DateTime.ISO.strUTC() the mx.DateTime representation of the field returned by pyPgSQL, I get

2011-01-13 08:01:04.00
2011-01-13 08:54:11+0000

I'm currently in UTC+11 (10+summer)

Any suggestions as to what might be happening here?

When I first connect to PostgreSQL, I always SET TIME ZONE 'UTC'.

cheers,
-Kingsley

PS> Cross-posted to the Egenix mailing list

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Pypgsql-users mailing list
Pypgsql-users@...
https://lists.sourceforge.net/lists/listinfo/pypgsql-users
Karsten Hilbert | 13 Jan 2011 08:32
Picon

Re: mxDateTime on pyPgSQL/PostgreSQL applies timezone?

On Thu, Jan 13, 2011 at 09:56:49AM +1100, Kingsley Turner wrote:

>    2011-01-13 08:54:11+0000

...

> When I first connect to PostgreSQL, I always SET TIME ZONE 'UTC'.

UTC *is* +0000 ?

Karsten
--

-- 
GPG key ID E4071346  <at>  wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl

Gmane