Compare a DateTime to the current date
Posted
by looloobs
on Stack Overflow
See other posts from Stack Overflow
or by looloobs
Published on 2010-06-03T20:53:05Z
Indexed on
2010/06/03
21:34 UTC
Read the original article
Hit count: 180
Hi I am trying to use a condition on events when the start_at DateTime is equal to or greater than Today's date. I want to list upcoming events, but clearly they are not upcoming if they have already passed.
I have:
@appointments = Event.find(:all, :conditions => ['move_id = ? AND start_at = ?', @move.id, Date.today])
I think I may be comparing apples and oranges here. It doesn't throw and error, just doesn't do what it is supposed to.
Help! Thanks in advance.
© Stack Overflow or respective owner