定制 nicolasleborgne/moon-phases-calculator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Latest Stable Version Latest Unstable Version Total Downloads License

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固