aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/values
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/values')
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index a52eee3e7c..401b669a0a 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -183,14 +183,8 @@ class TimeZone
# Time.zone = "Hawaii" # => "Hawaii"
# Time.zone.local(2007, 2, 1, 15, 30, 45) # => Thu, 01 Feb 2007 15:30:45 HST -10:00
def local(*args)
- t = Time.utc_time(*args)
- begin
- result = local_to_utc(t)
- rescue TZInfo::PeriodNotFound
- t += 1.hour
- retry
- end
- result.in_time_zone(self)
+ time = Time.utc_time(*args)
+ ActiveSupport::TimeWithZone.new(nil, self, time)
end
# Returns an ActiveSupport::TimeWithZone instance representing the current time