PHPackages                             since/lunar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. since/lunar

ActiveLibrary

since/lunar
===========

新历农历日期互转

1.0(5y ago)0112MITPHPPHP ^7.0

Since Jul 15Pushed 5y agoCompare

[ Source](https://github.com/zhan11400/lunar)[ Packagist](https://packagist.org/packages/since/lunar)[ RSS](/packages/since-lunar/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

农历与新历互转
=======

[](#农历与新历互转)

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

安装
--

[](#安装)

> 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);
    }
}

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2132d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41a6543979942d685e7df398addd15acf91e076b44b5539a2d6092dd1df42697?d=identicon)[zhan11400](/maintainers/zhan11400)

---

Top Contributors

[![zhan11400](https://avatars.githubusercontent.com/u/37530542?v=4)](https://github.com/zhan11400 "zhan11400 (3 commits)")

### Embed Badge

![Health badge](/badges/since-lunar/health.svg)

```
[![Health](https://phpackages.com/badges/since-lunar/health.svg)](https://phpackages.com/packages/since-lunar)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
