0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby wrapper for the WorldTimeEngine.com API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

 Project Readme

Build Status

The WorldTimeEngine.com Ruby gem

Convert any IP address to current local time.

http://worldtimeengine.com/api/ip

Installation

Install the gem:

$ gem install worldtimeengine

Add it to your Gemfile:

gem 'worldtimeengine'

Configuration

WorldTimeEngine.configure do |config|
  config.api_key = YOUR_API_KEY
  config.timeout = 2 # in seconds
end

Synopsis

response = WorldTimeEngine.api('193.174.32.100')

response.version
=> '1.1'
response.location.region
=> 'Germany'
response.location.latitude
=> 53.25
response.location.longitude
=> 10.4

response.time.utc
=> 2012-08-25 14:10:29 UTC
response.time.local
=> 2012-08-25 16:10:29 +0200

response.time.zone.has_dst
=> true
response.time.zone.current.abbreviation
=> "CEST"
response.time.zone.current.description
=> "Central European Summer Time"
response.time.zone.current.utc_offset
=> '+02:00'
response.time.zone.current.is_dst
=> true
response.time.zone.current.effective_until
=> 2012-10-28 03:00:00 +0200

response.time.zone.next.abbreviation
=> 'CET'
response.time.zone.next.description
=> "Central European Time"
response.time.zone.next.utc_offset
=> "+01:00"
response.time.zone.next.is_dst
=> false
response.time.zone.next.effective_until
=> 2013-03-31 02:00:00 +0100

Copyright

Copyright (c) 2012 Nikita Fedyashev. See LICENSE for details.