# File lib/dbi/sql.rb, line 56 def as_timestamp(str) return nil if str.nil? or str.empty? ary = ParseDate.parsedate(str) begin time = ::Time.gm(*(ary[0,6])) if ary[6] =~ /^(\+|\-)\d+$/ diff = ary[6].to_i * 60 * 60 time -= diff time.localtime end DBI::Timestamp.new(time) rescue ArgumentError nil end end