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

Merge pull request #21625 from amitsuroliya/improve_docs

Improve Docs of ActiveSupport::TimeZone [ci skip]
This commit is contained in:
Andrew White 2015-09-17 16:52:22 +01:00
commit ff2a4ca756

View file

@ -23,7 +23,7 @@ module ActiveSupport
# config.time_zone = 'Eastern Time (US & Canada)'
# end
#
# Time.zone # => #<TimeZone:0x514834...>
# Time.zone # => #<ActiveSupport::TimeZone:0x514834...>
# Time.zone.name # => "Eastern Time (US & Canada)"
# Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00
#
@ -195,7 +195,7 @@ module ActiveSupport
# Assumes self represents an offset from UTC in seconds (as returned from
# Time#utc_offset) and turns this into an +HH:MM formatted string.
#
# TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00"
# ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00"
def seconds_to_utc_offset(seconds, colon = true)
format = colon ? UTC_OFFSET_WITH_COLON : UTC_OFFSET_WITHOUT_COLON
sign = (seconds < 0 ? '-' : '+')