diff options
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/oci_adapter.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/oci_adapter.rb b/activerecord/lib/active_record/connection_adapters/oci_adapter.rb index 8fb57f9c39..1db21d4324 100644 --- a/activerecord/lib/active_record/connection_adapters/oci_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/oci_adapter.rb @@ -55,13 +55,14 @@ begin def cast_to_date_or_time(value) return value if value.is_a? Date - guess_date_or_time (value.is_a? Time) ? - value : Time.local(*value.split(/\D+/).map{ |x| x.to_i }) + guess_date_or_time (value.is_a? Time) ? value : cast_to_time(value) end def cast_to_time(value) return value if value.is_a? Time - Time.local(2000, 1, 1,*value.split(/\D+/).map{ |x| x.to_i }) + time_array = ParseDate.parsedate value + time_array[0] ||= 2000; time_array[1] ||= 1; time_array[2] ||= 1; + Time.send Base.default_timezone, *time_array end def guess_date_or_time(value) |