Module: DateAndTime::Compatibility

Included in:
ActiveSupport::TimeWithZone, DateTime, Time
Defined in:
lib/active_support/core_ext/date_and_time/compatibility.rb

Instance Method Summary collapse

Instance Method Details

#to_timeObject



14
15
16
17
18
19
20
# File 'lib/active_support/core_ext/date_and_time/compatibility.rb', line 14

def to_time
  if preserve_timezone
    @_to_time_with_instance_offset ||= getlocal(utc_offset)
  else
    @_to_time_with_system_offset ||= getlocal
  end
end