Giter VIP home page Giter VIP logo

lunar's Introduction

农历与新历互转

农历转新历,新历转农历 获得某年的生肖,获取农历某月的总天数 农历某天从春节至今的天数

安装

composer require since/lunar dev-master

调用例子

use since\Lunar;
class Index
{


    public function index(){
        $lunar=new Lunar();
        //农历转新历,当这个月是闰月时,第四个参数为true
        $lunar->convertLunarToSolar('2020','06','01');//
        //新历转农历
        $lunar->convertSolarToLunar('2020','06','01');//
        //某个月的所有新历与农历数据,当传第三个参数日期时,返回当天的新历与农历数据
        $arr=$lunar->convertSolarMonthToLunar("2020",'06');
        //判断某年是不是闰年
        $lunar->isLeapYear(2020);
        //获得某年的生肖
        $lunar->getYearZodiac(2020);
        //获取农历某月的总天数
        $lunar->getLunarMonthDays(2020,01);
        //获取某年的所有月份的天数
        $lunar->getLunarMonths(2019);
        //获取农历某年的总天数
        $lunar->getLunarYearDays(2020);
        //获得某年的闰月
        $lunar->getLeapMonth(2020);
        //农历某天从春节至今的天数,传农历日期,当这个月是闰月时,第四个参数为true,当这个月是闰月时,第四个参数为true
        $lunar->getDaysBetweenLunar(2020,07,15);
        //两个日期至今相隔天数
        $lunar->getDaysBetweenSolar(2020,06,02,05,01);
    }
}

lunar's People

Contributors

zhan11400 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.