0.0
No commit activity in last 3 years
No release in over 3 years
City timezone allows you to lookup the timezone for most cities in the world with a population > 15k.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

City Time Zone

City Time Zone does exactly one thing - tell you the time zone of a given city.

Usage

The simplest (and currently only) way to use city time zone is this:

require 'city_time_zone'

CityTimeZone.lookup "City name"

At the moment this returns the time zone using the same name as ActiveSupport::TimeZone uses. This differs from the format used by tz databases, and not all TZ time zones map to ActiveSupport ones. The lookup suffers accordingly. Future versions of this gem will rectify that.

The first time you call #lookup it will take a few seconds to return as it populates its database with the cities from the data file.

Data

City time zone data uses data from GeoNames. This is found in the data/cities.txt file