Skip to content

Instantly share code, notes, and snippets.

@ysawa
Created November 30, 2011 11:00
Show Gist options
  • Save ysawa/1408682 to your computer and use it in GitHub Desktop.
Save ysawa/1408682 to your computer and use it in GitHub Desktop.
calculate age from birthday
birth = Time.parse('1986/06/08')
(Time.now.strftime("%Y%m%d").to_i - birth.strftime("%Y%m%d").to_i) / 10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment