Socket
Book a DemoInstallSign in
Socket

city_time_zone

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

city_time_zone

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 10 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.