Created
November 30, 2011 11:00
-
-
Save ysawa/1408682 to your computer and use it in GitHub Desktop.
calculate age from birthday
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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