instance method
to_time
Ruby on Rails 8.0.4
Since v2.2.3Signature
to_time()
Returns an instance of Time, either with the same timezone as self, with the same UTC offset as self or in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.
Source
# File activesupport/lib/active_support/time_with_zone.rb, line 493
def to_time
if preserve_timezone == :zone
@to_time_with_timezone ||= getlocal(time_zone)
elsif preserve_timezone
@to_time_with_instance_offset ||= getlocal(utc_offset)
else
@to_time_with_system_offset ||= getlocal
end
end
Defined in activesupport/lib/active_support/time_with_zone.rb line 493
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::TimeWithZone