Created
October 16, 2012 03:18
-
-
Save superscott/3897081 to your computer and use it in GitHub Desktop.
Rails Date.today oddity
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
Ruby 1.9.2 -- Rails 3.2.8 | |
1.9.2p320 :001 > Date.today | |
=> Mon, 15 Oct 2012 | |
1.9.2p320 :002 > Date.tomorrow | |
=> Wed, 17 Oct 2012 | |
1.9.2p320 :003 > Date.yesterday | |
=> Mon, 15 Oct 2012 | |
1.9.2p320 :004 > Time.zone | |
=> (GMT+00:00) UTC | |
Ruby 1.9.3 -- Rails 3.2.8 | |
1.9.3p194 :003 > Date.today | |
=> Mon, 15 Oct 2012 | |
1.9.3p194 :004 > Date.yesterday | |
=> Mon, 15 Oct 2012 | |
1.9.3p194 :005 > Date.tomorrow | |
=> Wed, 17 Oct 2012 | |
1.9.3p194 :006 > Time.zone | |
=> (GMT+00:00) UTC | |
Ruby 1.9.3 -- Rails 3.2.7 | |
1.9.3p194 :003 > Date.today | |
=> Mon, 15 Oct 2012 | |
1.9.3p194 :004 > Date.yesterday | |
=> Mon, 15 Oct 2012 | |
1.9.3p194 :005 > Date.tomorrow | |
=> Wed, 17 Oct 2012 | |
1.9.3p194 :006 > Time.zone | |
=> (GMT+00:00) UTC | |
Ruby 1.8.7 -- Rails 2.3.11 | |
>> Date.today | |
=> Mon, 15 Oct 2012 | |
>> Date.yesterday | |
=> Sun, 14 Oct 2012 | |
>> Date.tomorrow | |
=> Tue, 16 Oct 2012 | |
>> Time.zone.to_s | |
=> "(GMT+00:00) UTC" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment