Method: TZInfo::Timezone.all_country_zones

Defined in:
lib/tzinfo/timezone.rb

.all_country_zonesArray<Timezone>

Returns an Array of all the time zones that are observed by at least one Country. This is not the complete set of time zones as some are not country specific (e.g. 'Etc/GMT').

TZInfo::TimezoneProxy instances are returned to avoid the overhead of loading time zone data until it is first needed.

Returns:

  • (Array<Timezone>)

    an Array of all the time zones that are observed by at least one Country.



206
207
208
# File 'lib/tzinfo/timezone.rb', line 206

def all_country_zones
  Country.all.map(&:zones).flatten.uniq
end