Ok, I'm an idiot. This query works perfectly. My problem was with the table definition and setting the default.
Sorry for the noise. BEN On Jun 9, 2:52 pm, BenH <ben.hesk...@gmail.com> wrote: > Hi, > > Sorry if this is an obvious question but I can't find the answer, > perhaps my Google-fu is weak. > > I have a table 'Item' with an 'expires' DateTime column, I want to > test it against now() and check whether the item in the table is out > of date. > > I've tried: > > session.query(Item).filter(Item.expires < now()).all() > > and it returns 0 results no matter what is in the 'expires' column. > > The few references I can find to working with DateTime talk about > doing DB specific conversions but they were from several years ago and > I wonder if things have been fixed since. > > Thanks for your help > > Ben -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.