# File lib/dbi/types.rb, line 135
            def self.parse_string str
                # special casing the common formats here gives roughly an
                # 8-fold speed boost over using Date._parse
                case str
                when /^(\d{4})-(\d{2})-(\d{2})(?: (\d{2}):(\d{2}):(\d{2})(\.\d+)?)?(?: ([+-]?\d{2}):?(\d{2}))?$/
                    parts = $~[1..-4].map { |s| s.to_i }
                    # i feel unclean. if we have fractional seconds, pad the number and then stuff it into a rational.
                    if $7
                        frac = $7.to_f * 10000000
                        parts << Rational(frac.to_i, 864000000000)
                    else
                        parts << 0
                    end
                    parts << Rational(($8 || 0).to_i * 60 + ($9 || 0).to_i, 1440)
                else
                    parts = ::Date._parse(str).values_at(:year, :mon, :mday, :hour, :min, :sec, :sec_fraction, :offset)
                    # some defaults
                    today = nil
                    8.times do |i|
                        next if parts[i]
                        today ||= ::Time.now.to_a.values_at(5, 4, 3) + [0, 0, 0, 0, 0]
                        parts[i] = today[i]
                    end
                    parts[6] = parts[6].kind_of?(Rational) ? parts[6] : Rational(parts[6], 1)
                    parts[6] *= Rational(1, 86400)
                    parts[7] = Rational(parts[7], 86400)
                end
                parts
            end