module Sequel::DateTimeParseToTime

Private Instance Methods

convert_input_timestamp(v, input_timezone) click to toggle source

Use DateTime.parse.to_time to do the conversion if the input a string and is assumed to be in UTC and there is no offset information in the string.

Calls superclass method
# File lib/sequel/extensions/datetime_parse_to_time.rb, line 20
def convert_input_timestamp(v, input_timezone)
  if v.is_a?(String) && datetime_class == Time && input_timezone == :utc && !Date._parse(v).has_key?(:offset)
    t = DateTime.parse(v).to_time
    case application_timezone
    when nil, :local
      t = t.localtime
    end
    t
  else
    super
  end
rescue => e
  raise convert_exception_class(e, Sequel::InvalidValue)
end