instance method
to_a
Ruby on Rails 8.1.2
Since v2.2.3Signature
to_a()
Returns Array of parts of Time in sequence of [seconds, minutes, hours, day, month, year, weekday, yearday, dst?, zone].
now = Time.zone.now # => Tue, 18 Aug 2015 02:29:27.485278555 UTC +00:00 now.to_a # => [27, 29, 2, 18, 8, 2015, 2, 230, false, "UTC"]
Source
# File activesupport/lib/active_support/time_with_zone.rb, line 461
def to_a
[time.sec, time.min, time.hour, time.day, time.mon, time.year, time.wday, time.yday, dst?, zone]
end
Defined in activesupport/lib/active_support/time_with_zone.rb line 461
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::TimeWithZone