Yes, It's psycopg2.

I wasn't aware that it does the conversion itself until after I posted my 
question. I ended up doing what you said. :)

Thanks! 

On Monday, November 19, 2012 7:27:01 AM UTC-8, Michael Bayer wrote:
>
> is this psycopg2 ?  If you use Python datetime objects with the tz 
> attribute set, it should just work, psycopg2 should do that conversion for 
> you (haven't checked, but typically they are pretty good in this area).
>
> Otherwise there are some SQLAlchemy routes to this, including the 
> @compiles extension as well as the ability to associate SQL expressions 
> with types.
>
> If it were me, I'd advise just running your dates through a TZ conversion 
> function on the Python side first so that they are in the TZ expected by 
> the database beforehand.   A custom type can also do this.
>
>
>
> On Nov 19, 2012, at 1:03 AM, espresso maker wrote:
>
> Hi,
>
> I have a table 'my_log' with a created_at column of type timestamp with 
> time zone;
>
> class Log(Base):
>     __tablename__ = "my_log"
>       ....
>       created_at = Column(DateTime(timezone=True), nullable=False,
>                         server_default=func.now())
>
>
> I would like to query Log and have created_at append: at time zone 
> '<timezone>'  without going through many hoops.
>
>
> Any thoughts of implementing it cleanly?
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/sqlalchemy/-/245CZe0qjvYJ.
> To post to this group, send email to [email protected]<javascript:>
> .
> To unsubscribe from this group, send email to 
> [email protected] <javascript:>.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/k8y7WpO3SxQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to