Reputation: 2136
I am trying to create recurring events with based on a gap in the timestamp and experiencing what seems to be odd behavior: if I continue to increase a timestamp by a weekly gap (604800 seconds), Rails seems to change the timezone on me.
t = Time.new(2015, 2, 22, 14, 0)
=> 2015-02-22 14:00:00 -0500
gap = 60 * 60 * 24 * 7
=> 604800
newt = t + gap
=> 2015-03-01 14:00:00 -0500
newt + gap
=> 2015-03-08 15:00:00 -0400
What am I doing wrong? Or what am I doing to cause this timezone issue?
Upvotes: 0
Views: 52
Reputation: 24337
It is because the time zone changes from standard time to daylight savings time on March 8th, 2015.
Upvotes: 1