1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed to_datetime docs [ci skip]

This commit is contained in:
Ronak Jangir 2015-08-26 10:18:20 +05:30
parent 51c7ac142d
commit 1be7fcad6b

View file

@ -369,9 +369,10 @@ module ActiveSupport
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