Method: ActiveSupport::TimeWithZone#to_time
- Defined in:
- lib/active_support/time_with_zone.rb
#to_time ⇒ Object
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
.
495 496 497 498 499 500 501 |
# File 'lib/active_support/time_with_zone.rb', line 495 def to_time if preserve_timezone @to_time_with_instance_offset ||= getlocal(utc_offset) else @to_time_with_system_offset ||= getlocal end end |