instance method
time_with_zone
Ruby on Rails 6.1.7.10
Since v4.1.16 PrivateSignature
time_with_zone(time, zone)
No documentation comment.
Parameters
-
timereq -
zonereq
Source
# File activesupport/lib/active_support/core_ext/date_and_time/zones.rb, line 32
def time_with_zone(time, zone)
if time
ActiveSupport::TimeWithZone.new(time.utc? ? time : time.getutc, zone)
else
ActiveSupport::TimeWithZone.new(nil, zone, to_time(:utc))
end
end
Defined in activesupport/lib/active_support/core_ext/date_and_time/zones.rb line 32
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in DateAndTime::Zones