Skip to content

r11132a/ex_timezone_db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExTimezoneDB

Travis: Travis CI Build Status

ExTimezoneDB is a simple interface to the TimeZoneDB REST API

Currently, only three functions are available:

  • get_timezone_by_name Which is used to find timezone information by name(ie "America/New_York")
  • get_timezone_by_position Which is used to find timezone information by latitude and longitude
  • get_timezone_by_city Which is used to find timezone(s) by using the name of the city. Potentially returns mutliple time zones.

Installation

Add ExTimezoneDB to your mix.exs:

  
  defp deps do
    [
      {:ex_timezone_db, github: "r11132a/ex_timezone_db", branch: "master"}
    ]

Dependencies

ExTimezoneDB relies on HTTPoison and Poison for http requests and json parsing, respectivly.

Usage

In config.exs

  
  config :ex_timezone_db,api_key: YOUR_API_KEY

The following is optional (defaults to false), but should be set if you have a Premium key (value is a boolean)

  config :ex_timezone_db, premium: true

In your code:

  {:ok,timezone_info} = ExTimezoneDB.get_timezone_by_name("America/New_York")

About

Simple elixir interface to TimeZoneDB (http://www.timezonedb.com)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages