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
21 def convert_input_timestamp(v, input_timezone)
22   if v.is_a?(String) && datetime_class == Time && input_timezone == :utc && !_date_parse(v).has_key?(:offset)
23     # :nocov:
24     # Whether this is fully branch covered depends on the order in which the specs are run.
25     v = handle_date_parse_input(v) if respond_to?(:handle_date_parse_input, true)
26     # :nocov:
27     t = DateTime.parse(v).to_time
28     case application_timezone
29     when nil, :local
30       t = t.localtime
31     end
32     t
33   else
34     super
35   end
36 rescue => e
37   raise convert_exception_class(e, Sequel::InvalidValue)
38 end