instance method
formatted_offset
Ruby on Rails 3.1.12
Since v3.0.20Signature
formatted_offset(colon = true, alternate_utc_string = nil)
Returns the UTC offset as an +HH:MM formatted string.
Time.local(2000).formatted_offset # => "-06:00" Time.local(2000).formatted_offset(false) # => "-0600"
Parameters
-
colonopt = true -
alternate_utc_stringopt = nil
Source
# File activesupport/lib/active_support/core_ext/time/conversions.rb, line 54
def formatted_offset(colon = true, alternate_utc_string = nil)
utc? && alternate_utc_string || ActiveSupport::TimeZone.seconds_to_utc_offset(utc_offset, colon)
end
Defined in activesupport/lib/active_support/core_ext/time/conversions.rb line 54
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Time