method
get_period_and_ensure_valid_local_time
v3.2.8 -
Show latest stable
- Class:
ActiveSupport::TimeWithZone
get_period_and_ensure_valid_local_time()private
No documentation available.
# File activesupport/lib/active_support/time_with_zone.rb, line 333
def get_period_and_ensure_valid_local_time
# we don't want a Time.local instance enforcing its own DST rules as well,
# so transfer time values to a utc constructor if necessary
@time = transfer_time_values_to_utc_constructor(@time) unless @time.utc?
begin
@time_zone.period_for_local(@time)
rescue ::TZInfo::PeriodNotFound
# time is in the "spring forward" hour gap, so we're moving the time forward one hour and trying again
@time += 1.hour
retry
end
end