Created
February 3, 2011 08:32
-
-
Save ono/809210 to your computer and use it in GitHub Desktop.
Kosuke's first program. "Dad, how many days until my 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
kaz:~ kazueono$ irb | |
>> bday = Time.local 2011,3,19 | |
=> Sat Mar 19 00:00:00 +0000 2011 | |
>> bday.yday | |
=> 78 | |
>> Time.now | |
=> Thu Feb 03 08:19:58 +0000 2011 | |
>> Time.now.yday | |
=> 34 | |
>> bday.yday - Time.now.yday | |
=> 44 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment