Skip to content

Instantly share code, notes, and snippets.

@hrysd
Created August 24, 2012 05:36
Show Gist options
  • Save hrysd/3445910 to your computer and use it in GitHub Desktop.
Save hrysd/3445910 to your computer and use it in GitHub Desktop.
#質問した年月日をつかってTimeクラスのインスタンスを作る。
myTime = Time.new(year, month, day)
# 今日の日付を作る
now = Time.new
#今日と聞いた日付の年の差を求める。
age = now.year - myTime.year
@hrysd
Copy link
Author

hrysd commented Aug 24, 2012

年齢計算の説明。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment