Update timestamp generation to support ActiveSupport::TimeWithZone #34

Merged
merged 1 commit into from Apr 3, 2013

Conversation

Projects
None yet
2 participants
Contributor

jgwhite commented Apr 3, 2013

We found that the current method for generating unix timestamps in ScriptTag can produce the wrong timestamp for ActiveSupport::TimeWithZone objects.

It seems that TimeWithZone#strftime('%s') will yield a timestamp that includes daylight savings offsets. The resulting timestamp will be an hour adrift if daylight savings are in effect.

This PR switches to using to_i directly on Time, DateTime and their descendants.

erskingardner added a commit that referenced this pull request Apr 3, 2013

Merge pull request #34 from withassociates/master
Update timestamp generation to support ActiveSupport::TimeWithZone

@erskingardner erskingardner merged commit 29e8319 into intercom:master Apr 3, 2013

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