https://github.com/minube/solar-position
https://github.com/minube/solar-position
solar-position-algorithms sun-position sunrise sunset
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/minube/solar-position
- Owner: minube
- Created: 2017-07-17T06:44:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-06T08:54:15.000Z (about 8 years ago)
- Last Synced: 2024-04-16T09:10:31.144Z (over 1 year ago)
- Topics: solar-position-algorithms, sun-position, sunrise, sunset
- Language: PHP
- Size: 5.86 KB
- Stars: 7
- Watchers: 12
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solar Position
Calculate the sunset and sunrise times for a particular location and date, as well as the different twilight phases (civil, nautical, astronomical) times.
More details about the different sun position phases in [timeanddate.com](https://www.timeanddate.com/astronomy/about-sun-calculator.html).## Input
* Date: array('day', 'month', 'year')
* Latitude
* Longitude## Output
* UTC [ DateTime](http://php.net/manual/es/class.datetime.php) object## Example
```php
use SolarPosition\Calculator;$latitude = 40.433202;
$longitude = -3.690161;
$date = array('day'=>23, 'month'=>6, 'year'=>2017);$sun = new Calculator();
$sunsetTime = $sun->getSunset($date, $latitude,$longitude);
/*
DateTime Object
(
[date] => 2017-06-23 19:48:35
[timezone_type] => 3
[timezone] => UTC
)
*/
```