Flowdock
method

fast_string_to_time

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: TimeValue
fast_string_to_time(string) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activemodel/lib/active_model/type/helpers/time_value.rb, line 72
          def fast_string_to_time(string)
            return unless ISO_DATETIME =~ string

            usec = $7.to_i
            usec_len = $7&.length
            if usec_len&.< 6
              usec *= 10**(6 - usec_len)
            end

            if $8
              offset = $8 == "Z" ? 0 : $8.to_i * 3600 + $9.to_i * 60
            end

            new_time($1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i, usec, offset)
          end
Register or log in to add new notes.