Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Ruby, using Sequel:

    DB[:cars].where { insurance_end_date < Time.now }.count
(replacing "Time.now" with Sequel.function("NOW") if you want server side, or whatever date/time formatting function you want that'll return time/date in your desired format client side; client side it'll be evaluated once)

I think most ORMs can do a reasonable job at this in languages where you have sufficient flexibility in overloading behaviour.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: