instance method formatted_offset

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available 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

colon opt = true
alternate_utc_string opt = 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

Defined in ActiveSupport::CoreExtensions::Time::Conversions

Type at least 2 characters to search.

↑↓ navigate · open · esc close