提交 f3ff72bc 编写于 作者: R Rafael Mendonça França

Merge pull request #21604 from amitsuroliya/remove_wrong_docs

Improving `in_time_zone` docs [ci skip]
...@@ -4,7 +4,7 @@ module Zones ...@@ -4,7 +4,7 @@ module Zones
# if Time.zone_default is set. Otherwise, it returns the current time. # if Time.zone_default is set. Otherwise, it returns the current time.
# #
# Time.zone = 'Hawaii' # => 'Hawaii' # Time.zone = 'Hawaii' # => 'Hawaii'
# DateTime.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00 # Time.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00
# Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00 # Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00
# #
# This method is similar to Time#localtime, except that it uses <tt>Time.zone</tt> as the local zone # This method is similar to Time#localtime, except that it uses <tt>Time.zone</tt> as the local zone
...@@ -14,7 +14,6 @@ module Zones ...@@ -14,7 +14,6 @@ module Zones
# and the conversion will be based on that zone instead of <tt>Time.zone</tt>. # and the conversion will be based on that zone instead of <tt>Time.zone</tt>.
# #
# Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00 # Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00
# DateTime.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00
# Date.new(2000).in_time_zone('Alaska') # => Sat, 01 Jan 2000 00:00:00 AKST -09:00 # Date.new(2000).in_time_zone('Alaska') # => Sat, 01 Jan 2000 00:00:00 AKST -09:00
def in_time_zone(zone = ::Time.zone) def in_time_zone(zone = ::Time.zone)
time_zone = ::Time.find_zone! zone time_zone = ::Time.find_zone! zone
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册