method
string_to_dummy_time
string_to_dummy_time(string)
public
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