Giter Site home page Giter Site logo

edsunriseset's Introduction

EDSunriseSet

Objective-C class to calculate Sunrise, Sunset, and Twilight times based on the user's current location and time zone.

EDSunriseSet is an Objective-C wrapper for the C languages routines created by Paul Schlyter. Calculation is done entirely by the C-code routines. EDSunrisetSet bridges those calculations to common cocoa classes like NSDate and NSTimeZone.

Features

  • Calculates Sunrise and Sunset times
  • Calculates Civil, Nautical, and Astronomical twilight
  • Times are calculated based on the provided timezone, latitute, and longitude

Documentation

To get information about the sunrise, sunset, and twilight use the method below.

+(EDSunriseSet *)sunrisesetWithTimezone:(NSTimeZone *)timezone latitude:(double)lat longitude:(double)longt

This method returns an EDSunriseSet object which can be used to access the following NSDateComponents each containing a date, hour, minute, and second:

  • The local sunrise time, localSunrise
  • The local sunset time, localSunset
  • The time when civil twilight (when the sun is 6 degrees below the horizon) begins and ends, localCivilTwilightStart and localCivilTwilightEnd
  • The time when nautical twilight (when the sun is 12 degrees below the horizon) begins and ends, localNauticalCivilTwilightStart and localNauticalCivilTwilightEnd
  • The time when astronomical twilight (when the sun is 18 degrees below the horizon) begins and ends, localAstronomicalTwilightStart and localAstronomicalTwilightEnd

You may also access NSDate proprties on EDSunriseSet which give a read-only value of the date for the specified property. These properties include sunrise and sunset among others.

License

EDSunriseSet license is MIT based. Attribution is appreciated, but not required.

edsunriseset's People

Contributors

erndev avatar t-unit avatar tonklon avatar

Watchers

 avatar

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.