Project

sun-times

0.0
No commit activity in last 3 years
No release in over 3 years
Module which calculates sunrise and sunset times.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

SunTimes

Build Status

This is a Fork of joeyates/ruby-sun-times and is avalible as sun-times gem so there is no explicit require necessary in Bundler projects.

Calculates sunrise and sunset times.

An implementation of the algorithm described at http://williams.best.vwh.net/sunrise_sunset_algorithm.htm

Installation

Add this line to your application's Gemfile:

gem 'sun-times'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sun-times

Usage

SunTimes.rise(Date.new(2010, 3, 8), 51.506318, 7.460659)             # => 2010-03-08 06:01:02 UTC
SunTimes.calculate(:set, Date.new(2010, 3, 8), 51.506318, 7.460659)  # => 2010-03-08 06:01:02 UTC
SunTimes.set(Date.new(2010, 3, 8), 51.506318, 7.460659)              # => 2010-03-08 17:22:07 UTC
SunTimes.calculate(:set, Date.new(2010, 3, 8), 51.506318, 7.460659)  # => 2010-03-08 17:22:07 UTC

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

References

License

MIT License (see LICENSE.txt)