instance method
at
Ruby on Rails 7.0.10
Since v2.2.3Signature
at(*args)
Method for creating new ActiveSupport::TimeWithZone instance in time zone of self from number of seconds since the Unix epoch.
Time.zone = 'Hawaii' # => "Hawaii" Time.utc(2000).to_f # => 946684800.0 Time.zone.at(946684800.0) # => Fri, 31 Dec 1999 14:00:00 HST -10:00
A second argument can be supplied to specify sub-second precision.
Time.zone = 'Hawaii' # => "Hawaii" Time.at(946684800, 123456.789).nsec # => 123456789
Parameters
-
argsrest
Source
# File activesupport/lib/active_support/values/time_zone.rb, line 370
def at(*args)
Time.at(*args).utc.in_time_zone(self)
end
Defined in activesupport/lib/active_support/values/time_zone.rb line 370
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::TimeZone