1. Go to this page and download the library: Download zachweix/php-zmanim 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/ */
zachweix / php-zmanim example snippets
$zmanim = Zmanim::create(2019, 2, 22, 'Lakewood', 40.0721087, -74.2400243, 39.57, 'America/New_York');
$zmanim->tzais72->format('Y-m-d\TH:i:sP'); // 2019-02-22T18:52:38-05:00
$jewishCalendar = Zmanim::jewishCalendar(Carbon::createFromDate(2023, 9, 30)); // This will give you a Jewish calendar date for the given date
$jewishCalendar = Zmanim::jewishCalendar(5784, 7, 15); // This will give the same date, but with the Jewish date given as parameters
$jewishCalendar->isRoshHashana(); // false
$jewishCalendar->isSuccos(); // true
$daf = $jewishCalendar->getDafYomiBavli();
$format = Zmanim::format();
$format->formatDafYomiBavli($daf); // Kiddushin 48
$jewishCalendar = Zmanim::jewishCalendar(5784, 7, 26);
$format->formatParsha($jewishCalendar); // Bereshis
PhpZmanim\Zmanim;
$zmanimInGMT = Zmanim::create(2019, 2, 21, "Greenwich");
$zmanim = Zmanim::create(2019, 2, 21, "New York City", 40.850519, -73.929214, 200, "America/New_York");
use PhpZmanim\Calendar\ComplexZmanimCalendar;
use PhpZmanim\Geo\GeoLocation;
$geoLocation = new GeoLocation("New York City", 40.850519, -73.929214, 200, "America/New_York");
$complexZmanimCalendar = new ComplexZmanimCalendar($geoLocation, 2019, 2, 21);
$zmanim->setCalculatorType($type); // 'SunTimes' and 'Noaa' are currently the only calculators
$zmanim->setDate($year, $month, $day); // Change current date
$zmanim->addDays($value); // Change current date, by adding requested number of days
$zmanim->subDays($value); // Change current date, by subtracting requested number of days
$zmanim->sunrise; // Get sunrise based on current elevation
$zmanim->seaLevelSunrise; // Get sunrise at zero elevation
$zmanim->beginCivilTwilight; // The point when sun's zenith is at 96 degrees
$zmanim->beginNauticalTwilight; // The point when sun's zenith is at 102 degrees
$zmanim->beginAstronomicalTwilight; // The point when sun's zenith is at 108 degrees
$zmanim->sunset; // Sunset based on current elevation
$zmanim->seaLevelSunset; // Sunset at zero elevation
$zmanim->endCivilTwilight; // The point when sun's zenith is at 96 degrees
$zmanim->endNauticalTwilight; // The point when sun's zenith is at 102 degrees
$zmanim->endAstronomicalTwilight; // The point when sun's zenith is at 108 degrees
$zmanim->sofZmanAchilasChametzGRA;
$zmanim->sofZmanAchilasChametzMGA72Minutes;
$zmanim->sofZmanAchilasChametzMGA16Point1Degrees;
$zmanim->sofZmanAchilasChametzBaalHatanya; // See note 3 below
$zmanim->sofZmanBiurChametzGRA;
$zmanim->sofZmanBiurChametzMGA72Minutes;
$zmanim->sofZmanBiurChametzMGA16Point1Degrees;
$zmanim->sofZmanBiurChametzBaalHatanya; // See note 3 below
$zmanim->chatzos; // This defaults to astronomical chatzos
$zmanim->chatzosAsHalfDay; // This defaults to halfway between sunrise and sunset and falls back to chatzos if that is not possible (e.g. the North Pole during summer)
$zmanim->fixedLocalChatzos; // See note 2 below
$zmanim->minchaGedola;
$zmanim->minchaGedola30Minutes;
$zmanim->minchaGedola72Minutes;
$zmanim->minchaGedola16Point1Degrees;
$zmanim->minchaGedolaAhavatShalom;
$zmanim->minchaGedolaGreaterThan30; // Fixed 30 minutes or degrees, whichever is later
$zmanim->minchaGedolaAteretTorah; // See note 1 below
$zmanim->minchaGedolaBaalHatanya; // See note 3 below
$zmanim->minchaGedolaBaalHatanyaGreaterThan30;
$zmanim->minchaGedolaGRAFixedLocalChatzos30Minutes;
$zmanim->minchaKetana;
$zmanim->minchaKetana16Point1Degrees;
$zmanim->minchaKetanaAhavatShalom;
$zmanim->minchaKetana72Minutes;
$zmanim->minchaKetanaAteretTorah; // See note 1 below
$zmanim->minchaKetanaBaalHatanya; // See note 3 below
$zmanim->minchaKetanaGRAFixedLocalChatzosToSunset;
$zmanim->samuchLeMinchaKetanaGRA;
$zmanim->samuchLeMinchaKetana16Point1Degrees;
$zmanim->samuchLeMinchaKetana72Minutes;
$zmanim->candleLighting; // Get sea level sunset minus candle lighting offset. Default is 18 minutes
$zmanim->setCandleLightingOffset($candleLightingOffset);