Rails and date: get profiles with related ages

Posted by Totty on Stack Overflow See other posts from Stack Overflow or by Totty
Published on 2010-04-07T12:51:57Z Indexed on 2010/04/07 12:53 UTC
Read the original article Hit count: 230

Filed under:

Hy,

I have a profile x, that has a born_date and then i want to get all the profiles that has more or less 5 years.

If profile x has 20 years, i want every profile that has between 15 and 25 years.

Here i need some date calculations and i dont really know how to do it. You have some ideas? ;)

© Stack Overflow or respective owner

Related posts about ruby-on-rails