Created
March 30, 2011 22:16
-
-
Save amuino/895427 to your computer and use it in GitHub Desktop.
Rails does really funny things in the late hours
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
# It is 00:15 | |
ruby-1.9.2-p180 :025 > Time.now | |
=> 2011-03-31 00:15:10 +0200 | |
# Today is 31st of March | |
ruby-1.9.2-p180 :023 > Date.today | |
=> Thu, 31 Mar 2011 | |
# Yesterday was 29 of March ????? WTF!!! | |
ruby-1.9.2-p180 :024 > Date.yesterday | |
=> Tue, 29 Mar 2011 | |
# Any of these works: | |
ruby-1.9.2-p180 :042 > Date.today.prev_day | |
=> Wed, 30 Mar 2011 | |
ruby-1.9.2-p180 :044 > Date.today - 1.day | |
=> Wed, 30 Mar 2011 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment