I have a table \"users\" with a column \"date_of_birth\" (DATE format with day, month, year). In frontend I need to list 5 upcoming birthdays.
Spent ages trying to w
Thanks to this post in my rails 3 app i use:
u = User.where("strftime('%m%d', date_of_birth) = ?", Date.today.strftime('%m%d'))
Update:
To use this with Postgresql:
u = User.where("extract(month from date_of_birth) = ? AND extract(day from date_of_birth) = ?", Date.today.strftime('%m'), Date.today.strftime('%d'))