We want to get all the people that are born on a certain date. For the moment we use the query like this :
User.where(["day(birthdate) = day(?) AND month(birtdate) = month(?)", Time.now.utc, Time.now.utc ])
Now when we safe a user with date 29/03/1989 in the form, the field birthdate in the db contains this : 28/03/1989 22:00:00 UTC+2
The problem is that mysql will take 28 as day instead of 29 when we use the day() function of mysql.
How can I fix this?