Created
August 24, 2012 05:36
-
-
Save hrysd/3445910 to your computer and use it in GitHub Desktop.
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
#質問した年月日をつかってTimeクラスのインスタンスを作る。 | |
myTime = Time.new(year, month, day) | |
# 今日の日付を作る | |
now = Time.new | |
#今日と聞いた日付の年の差を求める。 | |
age = now.year - myTime.year |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
年齢計算の説明。