John H. wrote in post #1017234:
ruby-1.9.2-p180 :023 > range =
=> Fri, 19 Aug 2011 00:00:00 UTC +00:00..Fri, 19 Aug 2011 23:59:59 UTC
The above statement actually makes less sense than you might think.
Date.tomorrow returns an object of type Date. Date objects have no
notion of time, so therefore have no notion of time zone.
=> Sat, 20 Aug 2011
Notice there is no notion of time, therefore calling beginning_of_day on
Date.tomorrow is somewhat meaningless. Rails translates this to mean
"midnight in whatever time zone is specified by config.time_zone =
'Eastern Time (US & Canada)' in config/application.rb or midnight UTC if
not specified." Your range above is showing
=> Sat, 20 Aug 2011 00:00:00 UTC +00:00
config.time_zone = 'Eastern Time (US & Canada)'
=> Sat, 20 Aug 2011 00:00:00 EDT -04:00
Notice these both represent midnight, but they are not the same instant
Looking at your example:
t = Time.now + 1.day
=> 2011-08-17 22:17:00 -0700
=> 2011-08-18 05:17:00 UTC
The above are both represent the same instant in time.