From fffbcf286762b9f78dec19c59aaa8ce0babb5551 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 4 May 2014 11:52:26 +0000 Subject: * lib/time.rb (Time.force_zone!): Use usual local time if it has expected offset from UTC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/time.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/time.rb b/lib/time.rb index e394078a03..f080718dff 100644 --- a/lib/time.rb +++ b/lib/time.rb @@ -178,7 +178,10 @@ class Time if zone_utc?(zone) t.utc elsif offset ||= zone_offset(zone) - t.localtime(offset) + t.localtime + if t.utc_offset != offset + t.localtime(offset) + end else t.localtime end -- cgit v1.2.3