mxDateTime on pyPgSQL/PostgreSQL applies timezone?
Kingsley Turner <kingsley.turner-jEoFCcbHCOSJLVpJL2nGXleTHsez0gnBQQ4Iyu8u01E@public.gmane.org> Thu, 13 Jan 2011 09:56:49 +1100
| Newsgroups | gmane.comp.python.db.pypgsql.user |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============5422129470736195418==
Content-Type: multipart/alternative;
boundary="------------050402080204070308060009"
This is a multi-part message in MIME format.
--------------050402080204070308060009
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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
--------------050402080204070308060009
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
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".<br>
<br>
Selecting my timestamp from PostgreSQL via psql gives:<br>
<br>
<blockquote><tt>2011-01-12 21:54:11</tt><br>
</blockquote>
<br>
Yet in my code, when I str() or mx.DateTime.ISO.strUTC() the
mx.DateTime representation of the field returned by pyPgSQL, I get<br>
<font color="#000000"><br>
</font>
<blockquote><font color="#000000"><tt>2011-01-13 08:01:04.00 </tt></font><br>
<font color="#000000"><tt>2011-01-13 08:54:11+0000</tt></font><br>
</blockquote>
<font color="#000000"><br>
I'm currently in UTC+11 (10+summer)<br>
<br>
Any suggestions as to what might be happening here?<br>
<br>
When I first connect to PostgreSQL, I always SET TIME ZONE 'UTC'.<br>
<br>
cheers,<br>
-Kingsley<br>
<br>
</font>
<div class="moz-signature"><font color="#000000">PS> Cross-posted
to the Egenix mailing list</font><br>
<br>
</div>
</body>
</html>
--------------050402080204070308060009--
--===============5422129470736195418==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
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
--===============5422129470736195418==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Pypgsql-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pypgsql-users
--===============5422129470736195418==--