PHPackages                             shiyin/calendar - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. shiyin/calendar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shiyin/calendar
===============

一个中国农历相关的小工具

v1.0(4y ago)012MITPHPPHP &gt;=7.4

Since Aug 23Pushed 4y agoCompare

[ Source](https://github.com/10in-tech/calendar)[ Packagist](https://packagist.org/packages/shiyin/calendar)[ RSS](/packages/shiyin-calendar/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

历法
==

[](#历法)

安装使用
----

[](#安装使用)

- 安装

```
composer require shiyin/calendar
```

- 农历转公历

```
$a= Calendar::Lunar2Solar(2020, 4, 1, true);
print_r($a); // [2020, 5, 23]
```

- 公历转农历

```
$s = Calendar::Solar2Lunar(2020, 5, 23);
print_r($s); // [2020, 4, 1, 1]
```

- 构造公历对象

```
$l = Lunar::new(2020, 4, 1, true)
```

- 构造农历对象

```
$s = Solar::new(2020, 5, 23);
```

功能
--

[](#功能)

- 公历转农历
- 农历转公历
- 干支纪年法
- 属相
- 星座
- 节气

TODO
----

[](#todo)

- 对固定值结果不再重复计算，直接写公式计算的结果

参考
--

[](#参考)

[liujiawm/paipan](https://github.com/liujiawm/paipan)
[nozomi199/qimen\_star](https://github.com/nozomi199/qimen_star)

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

Every ~50 days

Total

2

Last Release

1769d ago

Major Versions

v1.0 → v2.x-dev2021-10-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/89234810?v=4)[实印](/maintainers/10in-tech)[@10in-tech](https://github.com/10in-tech)

---

Top Contributors

[![soonio](https://avatars.githubusercontent.com/u/18730233?v=4)](https://github.com/soonio "soonio (5 commits)")[![10in-tech](https://avatars.githubusercontent.com/u/89234810?v=4)](https://github.com/10in-tech "10in-tech (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shiyin-calendar/health.svg)

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

###  Alternatives

[trustpilot/module-reviews

The Trustpilot Review extension makes it simple and easy for merchants to collect reviews from their customers to power their marketing efforts, increase sales conversion, build their online reputation and draw business insights.

11946.9k](/packages/trustpilot-module-reviews)

PHPackages © 2026

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