diff --git a/lib/rackstash/buffer.rb b/lib/rackstash/buffer.rb index 518ce7d..aa5644c 100644 --- a/lib/rackstash/buffer.rb +++ b/lib/rackstash/buffer.rb @@ -217,7 +217,7 @@ module Rackstash def timestamp(time = nil) @timestamp ||= begin time ||= Time.now - time.utc.iso8601(ISO8601_PRECISION).freeze + time.getutc.iso8601(ISO8601_PRECISION).freeze end end end diff --git a/lib/rackstash/fields/abstract_collection.rb b/lib/rackstash/fields/abstract_collection.rb index 7a8068e..5dfa130 100644 --- a/lib/rackstash/fields/abstract_collection.rb +++ b/lib/rackstash/fields/abstract_collection.rb @@ -149,7 +149,7 @@ module Rackstash end return array when ::Time - return value.utc.iso8601(ISO8601_PRECISION).freeze + return value.getutc.iso8601(ISO8601_PRECISION).freeze when ::DateTime return value.to_time.utc.iso8601(ISO8601_PRECISION).freeze when ::Date diff --git a/spec/rackstash/buffer_spec.rb b/spec/rackstash/buffer_spec.rb index 4be0f1c..f92c3aa 100644 --- a/spec/rackstash/buffer_spec.rb +++ b/spec/rackstash/buffer_spec.rb @@ -304,7 +304,7 @@ describe Rackstash::Buffer do now = Time.parse('2016-10-17 13:37:00 +03:00') expect(Time).to receive(:now).once.and_return(now) - expect(now).to receive(:utc).once.and_return(now.utc) + expect(now).to receive(:getutc).once.and_return(now.getutc) expect(buffer.timestamp).to eql '2016-10-17T10:37:00.000Z' expect(buffer.timestamp).to eql '2016-10-17T10:37:00.000Z'