Timez
Timez is the API implementation of timezonedb for Ruby. Can use to get World Clock from the time zone or location for the Ruby Applications by json or xml.
Timez gem use the power of celluloid for concurrent API requests.
Installation
Add this line to your application's Gemfile:
gem 'timez'
And then execute:
$ bundle
Or install it yourself as:
$ gem install timez
Usage
First of all Register on timezonedb to get your key to access the API.
Get Time by time zone,
time = Timez.get_time('Asia/Colombo', 'YOUR_API_KEY')
Here is the time zone list, time zone list
Get Time by location,
time = Timez::Location.get_time('LATITUDE', 'LONGITUDE', 'YOUR_API_KEY')
Get Time as XML,
time = Timez::Xml.get_time('Asia/Colombo', 'YOUR_API_KEY')
Contributing
- Fork it ( https://github.com/abstractive/timez/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Developer: @dilumnavanjana
Mentor: @digitalextremist