Skip to content
bmalets edited this page Jul 20, 2015 · 7 revisions

WhichTime Gem Version Code Climate Test Coverage

Gem which gives you a simple way to find local time (timezone) of some place, address, city, region country or any other location which you want.

Just do this simple things:

  WhichTime.in "Kyiv", api_key: "AIzaSyCqfXRRJ1d8mCS_I0Kcs4XnaZ9KYRUrJVE"
  # => 2015-07-06 03:53:10 +0300
  WhichTime.in "Lviv", api_key: "AIzaSyCqfXRRJ1d8mCS_I0Kcs4XnaZ9KYRUrJVE"
  # => 2015-07-04 03:53:10 +0300
  WhichTime.in "Walldorf", api_key: "AIzaSyCqfXRRJ1d8mCS_I0Kcs4XnaZ9KYRUrJVE"
  # => 2015-07-04 02:53:10 +0300

OR

  somewhere = WhichTime.new "Kyiv", api_key: "AIzaSyCqfXRRJ1d8mCS_I0Kcs4XnaZ9KYRUrJVE"
  somewhere.time
  # => 2015-07-06 03:53:10 +0300

  somewhere = WhichTime.new "Lviv", api_key: "AIzaSyCqfXRRJ1d8mCS_I0Kcs4XnaZ9KYRUrJVE"
  somewhere.time
  # => 2015-07-04 03:53:10 +0300

  somewhere = WhichTime.new "Walldorf", api_key: "AIzaSyCqfXRRJ1d8mCS_I0Kcs4XnaZ9KYRUrJVE"
  somewhere.time
  # => 2015-07-04 02:53:10 +0300
Clone this wiki locally