# File lib/et-orbi.rb, line 25 def parse(str, opts={}) str, str_zone = extract_zone(str) if defined?(::Chronic) && t = ::Chronic.parse(str, opts) str = [ t.strftime('%F %T'), str_zone ].compact.join(' ') end begin DateTime.parse(str) rescue fail ArgumentError, "No time information in #{str.inspect}" end #end if RUBY_VERSION < '1.9.0' #end if RUBY_VERSION < '2.0.0' # # is necessary since Time.parse('xxx') in Ruby < 1.9 yields `now` zone = opts[:zone] || get_tzone(str_zone) || determine_local_tzone local = Time.parse(str) secs = zone.local_to_utc(local).to_f EoTime.new(secs, zone) end