Re: [(datetime.datetime(2013, 7, 29, 9, 2, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)]

From: <Christian(dot)Strobl(at)dlr(dot)de>
To: <Karsten(dot)Hilbert(at)gmx(dot)net>, <psycopg(at)postgresql(dot)org>
Subject: Re: [(datetime.datetime(2013, 7, 29, 9, 2, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)]
Date: 2013-08-01 13:25:53
Message-ID: BA25E6A9A6B2B54EB96F4F12F3683E0319E59A14@dlrexmbx02.intra.dlr.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg


hi karsten,

thanks a lot, i see now. i get a python datetime object, not a result string. i was to fixed to my database way of thinking

with

In [6]: rows[0][0].isoformat()
Out[6]: '2013-07-29T09:02:00+00:00'

i get what i want.

an additional question: for more complex queries it is a little bit time consuming to change all queries with mogrify. do you know if it is possible to send raw sql to the database and to get only the output from the database back without any kind of python object creation.

kind regards
christian

-----Ursprüngliche Nachricht-----
Von: psycopg-owner(at)postgresql(dot)org [mailto:psycopg-owner(at)postgresql(dot)org] Im Auftrag von Karsten Hilbert
Gesendet: Donnerstag, 1. August 2013 13:11
An: psycopg(at)postgresql(dot)org
Betreff: Re: [psycopg] [(datetime.datetime(2013, 7, 29, 9, 2, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)]

On Thu, Aug 01, 2013 at 09:24:11AM +0000, Christian(dot)Strobl(at)dlr(dot)de wrote:

> i want to create an timestamp with to_timestamp() and i get always an
> output like this
>
> [(datetime.datetime(2013, 7, 29, 9, 2,
> tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)]

...

> is this a problem of my code or a bug?

Neither. It is normal behaviour.

I suppose you are expecting something else but you'd need to explain that.

Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

--
Sent via psycopg mailing list (psycopg(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/psycopg

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Karsten Hilbert 2013-08-01 13:31:36 Re: [(datetime.datetime(2013, 7, 29, 9, 2, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)]
Previous Message Ryan Kelly 2013-08-01 12:11:19 Re: [(datetime.datetime(2013, 7, 29, 9, 2, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)]