2017 © Pedro Peláez
 

library moon-phases-calculator

A fully oriented object php package that allowed to compute moon phases. Accuracy is about a few minutes.

image

nicolasleborgne/moon-phases-calculator

A fully oriented object php package that allowed to compute moon phases. Accuracy is about a few minutes.

  • Saturday, December 24, 2016
  • by nicolasleborgne
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Latest Stable Version Latest Unstable Version Total Downloads License, (*1)

MoonPhaseCalculator

A php package that allowed to compute moon phases. Accuracy is about a few minutes., (*2)

Installation

Install the latest version with, (*3)

$ composer require nicolasleborgne/moon-phases-calculator

Basic Usage

<?php

use MoonPhaseCalculator\MoonPhaseCalculator;

/**
 * Create a new calculator object, 
 * it takes a mandatory DateTime first parameter and an optionnal timezone parameter
 */
$moonPhasesCalculator = new MoonPhaseCalculator(
                        new DateTime("2016-11-16", new DateTimeZone('Europe/Paris')), 
                        new DateTimeZone('Europe/Paris')
                        );
/**
 * Call getMoonPhaseFromDateTime() method to get the moon phase
 * associated to the dateTime given in param at the instanciation
 */
$moonPhase = $moonPhasesCalculator->getMoonPhaseFromDateTime();

/**
 * You can also change the DateTime wich used for calcul
 */
$moonPhasesCalculator->setDateTime(new DateTime("2016-12-08", new DateTimeZone('Europe/Paris'));

/**
 * To get directly the moon phase from the current date
 */
$moonPhasesCalculator->getCurrentMoonPhase();

/**
 * To get moon phases date for the current synodic period
 */
$moonPhasesCalculator->getNewMoon();
$moonPhasesCalculator->getWaxingCrescent();
$moonPhasesCalculator->getFirstQuarter();
$moonPhasesCalculator->getWaxingGibbous();
$moonPhasesCalculator->getFullMoon();
$moonPhasesCalculator->getWaningGibbous();
$moonPhasesCalculator->getLastQuarter();
$moonPhasesCalculator->getWaningCrescent();

The Versions

24/12 2016

dev-ci-improvment

dev-ci-improvment http://github.com/nicolasleborgne/MoonPhasesCalculator

A fully oriented object php package that allowed to compute moon phases. Accuracy is about a few minutes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Nicolas Le Borgne

astronomy moon phase phases

08/12 2016

dev-master

9999999-dev http://github.com/nicolasleborgne/MoonPhasesCalculator

A fully oriented object php package that allowed to compute moon phases. Accuracy is about a few minutes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Nicolas Le Borgne

astronomy moon phase phases

08/12 2016

v1.0.0

1.0.0.0 http://github.com/nicolasleborgne/MoonPhasesCalculator

A fully oriented object php package that allowed to compute moon phases. Accuracy is about a few minutes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Nicolas Le Borgne

astronomy moon phase phases