Sha256: 6e88b5a5b4ced089bb33fd933eaf83f0e2d0b2a25bd593b06a4fc57657bb1b11
Contents?: true
Size: 845 Bytes
Versions: 17
Compression:
Stored size: 845 Bytes
Contents
# frozen_string_literal: true require "active_support/core_ext/date_and_time/compatibility" require "active_support/core_ext/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 def preserve_timezone # :nodoc: active_support_local_zone == zone || super end private @@active_support_local_tz = nil def active_support_local_zone @@active_support_local_zone = nil if @@active_support_local_tz != ENV["TZ"] @@active_support_local_zone ||= begin @@active_support_local_tz = ENV["TZ"] Time.new.zone end end end
Version data entries
17 entries across 17 versions & 2 rubygems