instance method
utc?
Ruby on Rails 6.0.6
Since v2.2.3Signature
utc?()
Returns true if the current time zone is set to UTC.
Time.zone = 'UTC' # => 'UTC' Time.zone.now.utc? # => true Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' Time.zone.now.utc? # => false
Source
# File activesupport/lib/active_support/time_with_zone.rb, line 106
def utc?
period.offset.abbreviation == :UTC || period.offset.abbreviation == :UCT
end
Defined in activesupport/lib/active_support/time_with_zone.rb line 106
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::TimeWithZone