Module: ActiveModel::Type::Helpers::Timezone

Included in:
Date, DateTime, Time
Defined in:
activemodel/lib/active_model/type/helpers/timezone.rb

Instance Method Summary collapse

Instance Method Details

#default_timezoneObject



13
14
15
# File 'activemodel/lib/active_model/type/helpers/timezone.rb', line 13

def default_timezone
  is_utc? ? :utc : :local
end

#is_utc?Boolean

Returns:



9
10
11
# File 'activemodel/lib/active_model/type/helpers/timezone.rb', line 9

def is_utc?
  ::Time.zone_default.nil? || ::Time.zone_default.match?("UTC")
end