Created
October 20, 2011 01:05
-
-
Save brandon-beacher/1300144 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$ date | |
Wed Oct 19 21:04:30 EDT 2011 | |
$ rails console | |
>> Date.yesterday | |
=> Wed, 19 Oct 2011 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rails is timezone aware, and that Date is GMT (-0000 UTC). So since it's past 8 pm (-0500 EDT), you will get different results for "today" and "yesterday".