PHP code example of jiri.jozif / datesuninfo

1. Go to this page and download the library: Download jiri.jozif/datesuninfo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jiri.jozif / datesuninfo example snippets



use JiriJozif\DateSunInfo\DateSunInfo;

$dsi = DateSunInfo::getRiset(time(), 51.48, 0.0); //Royal Observatory, Greenwich
echo "The Sun rises today at ", DateSunInfo::hh_mm($dsi['sunrise']), " and sets at ", DateSunInfo::hh_mm($dsi['sunset']);


use JiriJozif\DateSunInfo\DateSunInfo;

DateSunInfo::setOptions([
    'height' => 300, // Observer on Eiffel tower
    'topographic_azimuth' => false, // Enable astronomical azimuth
    'altitude' => -0.583, // Swedish national alamancs
    'twilight' => [
            10 => ['golden_hour_end', 'golden_hour_begin'], // For photographer
            -15 => ['amateur_astronomical_twilight_begin', 'amateur_astronomical_twilight_end'] // For amateur astronomer
        ]
]);