method

parts_to_time

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: ActiveSupport::TimeZone
parts_to_time(parts, now) private

No documentation

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

Hide source
# File activesupport/lib/active_support/values/time_zone.rb, line 449
      def parts_to_time(parts, now)
        return if parts.empty?

        time = Time.new(
          parts.fetch(:year, now.year),
          parts.fetch(:mon, now.month),
          parts.fetch(:mday, parts[:year] || parts[:mon] ? 1 : now.day),
          parts.fetch(:hour, 0),
          parts.fetch(:min, 0),
          parts.fetch(:sec, 0) + parts.fetch(:sec_fraction, 0),
          parts.fetch(:offset, 0)
        )

        if parts[:offset]
          TimeWithZone.new(time.utc, self)
        else
          TimeWithZone.new(nil, self, time)
        end
      end
Register or log in to add new notes.