blob: 147ae0f8026ffe786278b854bbd40185aca35ca3 (
plain) (
tree)
|
|
# frozen_string_literal: true
require_relative "../date_and_time/compatibility"
require_relative "../module/redefine_method"
class Time
include DateAndTime::Compatibility
silence_redefinition_of_method :to_time
# Either return +self+ or the time in the local system timezone depending
# on the setting of +ActiveSupport.to_time_preserves_timezone+.
def to_time
preserve_timezone ? self : getlocal
end
end
|