Permalink
Browse files

Ticket #2282 - fix parsing of timestamps with time zone

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 3b108e7 commit ee5fe97ac4edbe1d2d6fbf034a485070286cfebb @jeremy jeremy committed Sep 30, 2005
@@ -1,3 +1,5 @@
+require 'parsedate'
+
module ActiveRecord
module ConnectionAdapters #:nodoc:
# An abstract definition of a column in a table.
@@ -78,7 +80,7 @@ def string_to_date(string)
def string_to_time(string)
return string unless string.is_a?(String)
- time_array = ParseDate.parsedate(string).compact
+ time_array = ParseDate.parsedate(string)[0..5]
# treat 0000-00-00 00:00:00 as nil
Time.send(Base.default_timezone, *time_array) rescue nil
end

0 comments on commit ee5fe97

Please sign in to comment.