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

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

Instance Method Summary collapse

Instance Method Details

#default_timezoneObject



17
18
19
# File 'lib/active_model/type/helpers/timezone.rb', line 17

def default_timezone
  is_utc? ? :utc : :local
end

#is_utc?Boolean

Returns:



9
10
11
12
13
14
15
# File 'lib/active_model/type/helpers/timezone.rb', line 9

def is_utc?
  if default = ::Time.zone_default
    default.name == "UTC"
  else
    true
  end
end