Skip to content

ahtung/sun_times.ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SunTimes

Build Status Coverage Status Hex.pm version Hex.pm downloads

Usage

In order to find the sunrise time in Amsterdam on the 14th of January:

lat = 52.3702
lon = 4.8952
day = Timex.to_date({2018 , 1, 14})

SunTimes.rise(day, lat, lon)

Similarly, in order to find the sunset time in Amsterdam on the same day:

lat = 52.3702
lon = 4.8952
day = Timex.to_date({2018 , 1, 14})

SunTimes.set(day, lat, lon)

Installation

If available in Hex, the package can be installed by adding sun_times to your list of dependencies in mix.exs:

def deps do
  [
    {:sun_times, "~> 0.1.2"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/sun_times.