Skip to content

Instantly share code, notes, and snippets.

@darkskiez
Created October 17, 2013 10:38

Revisions

  1. darkskiez created this gist Oct 17, 2013.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    $ export TZ=MST
    $ bundle exec rails c
    ruby-1.9.3-p0 :001 > t = Time.new(2013, 1, 1, 0, 0, 0, "+00:00")
    => 2013-01-01 00:00:00 +0000
    ruby-1.9.3-p0 :002 > t + 1.day
    => 2013-01-02 00:00:00 -0700
    ruby-1.9.3-p0 :003 > t + 1.day.to_i
    => 2013-01-02 00:00:00 +0000
    ruby-1.9.3-p0 :004 > 1.day.object_id
    => 172801
    ruby-1.9.3-p0 :005 > 1.day.to_i.object_id
    => 172801