diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-04 11:52:26 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-04 11:52:26 +0000 |
commit | fffbcf286762b9f78dec19c59aaa8ce0babb5551 (patch) | |
tree | fc2b4a32c1fb84a5825002daf10e433dd36acc86 /lib | |
parent | a18177d5ed270ba7007c12011b9693ec226b1ad6 (diff) | |
download | ruby-fffbcf286762b9f78dec19c59aaa8ce0babb5551.tar.gz |
* 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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/time.rb | 5 |
1 files changed, 4 insertions, 1 deletions
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 |