library solar-position
Solar Position PHP Library for sunset, sunrise, twilight phases time calculation.
minube/solar-position
Solar Position PHP Library for sunset, sunrise, twilight phases time calculation.
- Wednesday, September 6, 2017
- by abmo
- Repository
- 12 Watchers
- 3 Stars
- 7 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 3 Versions
- 0 % Grown
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., (*1)
- Date: array('day', 'month', 'year')
- Latitude
- Longitude
Output
Example
```php
use SolarPosition\Calculator;, (*2)
$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
)
*/
```, (*3)