提交 1be7fcad 编写于 作者: R Ronak Jangir

Fixed to_datetime docs [ci skip]

上级 51c7ac14
......@@ -369,9 +369,10 @@ def to_time
utc.to_time
end
# Returns an instance of DateTime in the UTC timezone.
# Returns an instance of DateTime with the timezone's UTC offset
#
# Time.zone.now.to_datetime # => Tue, 18 Aug 2015 02:32:20 +0000
# Time.zone.now.to_datetime # => Tue, 18 Aug 2015 02:32:20 +0000
# Time.current.in_time_zone('Hawaii').to_datetime # => Mon, 17 Aug 2015 16:32:20 -1000
def to_datetime
utc.to_datetime.new_offset(Rational(utc_offset, 86_400))
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册