instance method
formatted_offset
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
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 56
def formatted_offset(colon = true, alternate_utc_string = nil)
utc? && alternate_utc_string || utc_offset.to_utc_offset_s(colon)
end
Defined in activesupport/lib/active_support/core_ext/time/conversions.rb line 56
· View on GitHub
· Improve this page
· Find usages on GitHub