Skip to content

Commit

Permalink
Convert milliseconds to microseconds before passing to Time::utc
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Evans committed Jul 21, 2014
1 parent 6c55efb commit d06c28a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/aws/core/xml/frame.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def datetime_like_value klass, parts_constructor
# that AWS uses almost (??) everywhere.
if @text.tr(*TRANSLATE_DIGITS) == EASY_FORMAT
parts = @text.tr(*DATE_PUNCTUATION).chop.split.map {|p| p.to_i }
parts[-1] = parts[-1] * 1000
klass.send(parts_constructor, *parts)
else
# fallback in case we have to handle another date format
Expand Down
2 changes: 1 addition & 1 deletion spec/aws/core/xml/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ module XML

it 'can convert the standard amazon format to a time object' do
data.date_time_like_element.should be_a(Time)
data.date_time_like_element.to_s.should == Time.parse(time_string).to_s
data.date_time_like_element.strftime('%s.%6N').should == Time.parse(time_string).strftime('%s.%6N')
end

it 'can convert non standard amazon formats to time objects' do
Expand Down

0 comments on commit d06c28a

Please sign in to comment.