On Jul 6, 7:06 am, Nick <[EMAIL PROTECTED]> wrote:
> thanks, but that didn't work either. In the end i changed the func.<db
> call> to a datetime.datetime.now() python call which seems to work. I
> also noticed that i had to change all my date inserts to datetime
> objects as well (previously i was using postgres and inserted dates as
> date strings i.e. '2007-01-01' which seemed to work ok).
> I'm new to SA so perhaps i should have been doing that all along
> anyway.
> Cheers
> Nick

If you're ever planning to load-balance your web app, you probably
want the database to select the time instead of your various
application servers.  The SQL-92 way to do this (in UTC time!) is:

SELECT TIMESTAMP WITH TIME ZONE CURRENT_TIMESTAMP AT TIME ZONE '00:00'

you could just put that inside a text() block like so:

now = text("SELECT TIMESTAMP WITH TIME ZONE CURRENT_TIMESTAMP AT TIME
ZONE '00:00'")

and then use "default=now" in your table definition.

-Ian Charnas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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