Giter Club home page Giter Club logo

worldtimeengine's Introduction

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.

worldtimeengine's People

Contributors

nfedyashev avatar

Stargazers

Kagayaki (Kaga) Kawabata avatar

Watchers

 avatar James Cloos avatar

worldtimeengine's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.