nicolasleborgne/moon-phases-calculator
Composer 安装命令:
composer require nicolasleborgne/moon-phases-calculator
包简介
A fully oriented object php package that allowed to compute moon phases. Accuracy is about a few minutes.
关键字:
README 文档
README
MoonPhaseCalculator
A php package that allowed to compute moon phases. Accuracy is about a few minutes.
##Installation Install the latest version with
$ 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();
统计信息
- 总下载量: 72
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-28