mirror of
https://github.com/github/rails.git
synced 2026-01-26 23:08:58 -05:00
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
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
require 'parsedate'
|
||||
|
||||
module ActiveRecord
|
||||
module ConnectionAdapters #:nodoc:
|
||||
# An abstract definition of a column in a table.
|
||||
@@ -78,7 +80,7 @@ module ActiveRecord
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user