Guest User

Untitled

a guest
May 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. birthday_past = Time.now - 18.years - 2.days
  2. birthday_future = Time.now - 18.years + 2.days
  3. ((Date.today - birthday_past.to_date) / 365).floor
  4. #18
  5. >> ((Date.today - birthday_future.to_date) / 365).floor
  6. #18 -> should be 17!
Add Comment
Please, Sign In to add comment