Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/kredis/type/datetime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Kredis
module Type
class DateTime < ActiveModel::Type::DateTime
def serialize(value)
super&.iso8601(9)
super&.utc&.iso8601(9)
end

def cast_value(value)
Expand Down
2 changes: 1 addition & 1 deletion test/types/list_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ListTest < ActiveSupport::TestCase
test "typed as datetime" do
@list = Kredis.list "mylist", typed: :datetime

@list.append [ 1.day.from_now.midnight, 2.days.from_now.midnight ]
@list.append [ 1.day.from_now.midnight.in_time_zone("Pacific Time (US & Canada)"), 2.days.from_now.midnight.in_time_zone("UTC") ]
assert_equal [ 1.day.from_now.midnight, 2.days.from_now.midnight ], @list.elements

@list.remove(2.days.from_now.midnight)
Expand Down