instance method
to_time
Ruby on Rails 7.1.6
Since v2.2.3Signature
to_time()
Returns an instance of Time, either 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 485
def to_time
if 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 485
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::TimeWithZone