Flowdock
method

string_to_dummy_time

Importance_0
v1.2.6 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::Column
string_to_dummy_time(string) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 121
      def self.string_to_dummy_time(string)
        return string unless string.is_a?(String)
        return nil if string.empty?
        time_hash = Date._parse(string)
        time_hash[:sec_fraction] = microseconds(time_hash)
        # pad the resulting array with dummy date information
        time_array = [2000, 1, 1]
        time_array += time_hash.values_at(:hour, :min, :sec, :sec_fraction)
        Time.send(Base.default_timezone, *time_array) rescue nil
      end
Register or log in to add new notes.