Skip to content

Instantly share code, notes, and snippets.

@brandon-beacher
Created October 20, 2011 01:05
Show Gist options
  • Save brandon-beacher/1300144 to your computer and use it in GitHub Desktop.
Save brandon-beacher/1300144 to your computer and use it in GitHub Desktop.
$ date
Wed Oct 19 21:04:30 EDT 2011
$ rails console
>> Date.yesterday
=> Wed, 19 Oct 2011
@seebq
Copy link

seebq commented Oct 20, 2011

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".

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