diff --git a/app/views/messages/suppressions.html.haml b/app/views/messages/suppressions.html.haml
index 39846ff..8c084bf 100644
--- a/app/views/messages/suppressions.html.haml
+++ b/app/views/messages/suppressions.html.haml
@@ -22,5 +22,5 @@
%p.suppressionList__address= link_to suppression['address'], outgoing_organization_server_messages_path(organization, @server, :query => "to: #{suppression['address']}")
%p.suppressionList__reason= suppression['reason'].capitalize
.suppressionList__right
- %p.suppressionList__timestamp Added #{Time.at(suppression['timestamp']).to_s(:long)}
+ %p.suppressionList__timestamp Added #{Time.zone.at(suppression['timestamp']).to_s(:long)}
= render 'shared/message_db_pagination', :data => @suppressions, :name => "suppression"
diff --git a/lib/postal/message_db/click.rb b/lib/postal/message_db/click.rb
index 4429c6a..334a21c 100644
--- a/lib/postal/message_db/click.rb
+++ b/lib/postal/message_db/click.rb
@@ -6,7 +6,7 @@ module Postal
@url = link['url']
@ip_address = attributes['ip_address']
@user_agent = attributes['user_agent']
- @timestamp = Time.at(attributes['timestamp'])
+ @timestamp = Time.zone.at(attributes['timestamp'])
end
attr_reader :ip_address
diff --git a/lib/postal/message_db/delivery.rb b/lib/postal/message_db/delivery.rb
index e970436..b4903ac 100644
--- a/lib/postal/message_db/delivery.rb
+++ b/lib/postal/message_db/delivery.rb
@@ -26,7 +26,7 @@ module Postal
end
def timestamp
- @timestamp ||= @attributes['timestamp'] ? Time.at(@attributes['timestamp']) : nil
+ @timestamp ||= @attributes['timestamp'] ? Time.zone.at(@attributes['timestamp']) : nil
end
def update_statistics
diff --git a/lib/postal/message_db/load.rb b/lib/postal/message_db/load.rb
index 05fd11a..eae8d78 100644
--- a/lib/postal/message_db/load.rb
+++ b/lib/postal/message_db/load.rb
@@ -5,7 +5,7 @@ module Postal
def initialize(attributes)
@ip_address = attributes['ip_address']
@user_agent = attributes['user_agent']
- @timestamp = Time.at(attributes['timestamp'])
+ @timestamp = Time.zone.at(attributes['timestamp'])
end
attr_reader :ip_address
diff --git a/lib/postal/message_db/message.rb b/lib/postal/message_db/message.rb
index cd47108..8a320b8 100644
--- a/lib/postal/message_db/message.rb
+++ b/lib/postal/message_db/message.rb
@@ -97,21 +97,21 @@ module Postal
# Return the timestamp for this message
#
def timestamp
- @timestamp ||= @attributes['timestamp'] ? Time.at(@attributes['timestamp']) : nil
+ @timestamp ||= @attributes['timestamp'] ? Time.zone.at(@attributes['timestamp']) : nil
end
#
# Return the time that the last delivery was attempted
#
def last_delivery_attempt
- @last_delivery_attempt ||= @attributes['last_delivery_attempt'] ? Time.at(@attributes['last_delivery_attempt']) : nil
+ @last_delivery_attempt ||= @attributes['last_delivery_attempt'] ? Time.zone.at(@attributes['last_delivery_attempt']) : nil
end
#
# Return the hold expiry for this message
#
def hold_expiry
- @hold_expiry ||= @attributes['hold_expiry'] ? Time.at(@attributes['hold_expiry']) : nil
+ @hold_expiry ||= @attributes['hold_expiry'] ? Time.zone.at(@attributes['hold_expiry']) : nil
end
#
diff --git a/lib/postal/message_db/statistics.rb b/lib/postal/message_db/statistics.rb
index e34db8c..cd686e8 100644
--- a/lib/postal/message_db/statistics.rb
+++ b/lib/postal/message_db/statistics.rb
@@ -45,7 +45,7 @@ module Postal
end
end
@database.select("stats_#{type}", :where => {:time => items.keys.map(&:to_i)}, :fields => [:time] | counters).each do |data|
- time = Time.at(data.delete('time'))
+ time = Time.zone.at(data.delete('time'))
data.each do |key, value|
items[time][key.to_sym] = value
end
diff --git a/lib/postal/message_db/webhooks.rb b/lib/postal/message_db/webhooks.rb
index 15f84d4..b90430e 100644
--- a/lib/postal/message_db/webhooks.rb
+++ b/lib/postal/message_db/webhooks.rb
@@ -40,7 +40,7 @@ module Postal
end
def timestamp
- Time.at(@attributes['timestamp'])
+ Time.zone.at(@attributes['timestamp'])
end
def event