Quote date/time values for use in SQL input. Includes microseconds if the
value is a Time responding to usec.
# File activerecord/lib/active_record/connection_adapters/abstract/quoting.rb, line 141
def quoted_date(value)
if value.acts_like?(:time)
if default_timezone == :utc
value = value.getutc if !value.utc?
else
value = value.getlocal
end
end
result = value.to_fs(:db)
if value.respond_to?(:usec) && value.usec > 0
result << "." << sprintf("%06d", value.usec)
else
result
end
end