PHPackages                             vrobin/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. vrobin/calendar

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

vrobin/calendar
===============

中国农历转换,生肖星座

v1.0.2(4y ago)11.9kMITPHPPHP &gt;=7.1.0

Since Apr 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/health901/Calendar)[ Packagist](https://packagist.org/packages/vrobin/calendar)[ RSS](/packages/vrobin-calendar/feed)WikiDiscussions master Synced 1w ago

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

Calendar
========

[](#calendar)

中国农历转换,生肖星座

---

[![Packagist PHP Version Support](https://camo.githubusercontent.com/7933e453f8faca11ae68dd034c9067fd13c34492b031393eba8d7b6170d777c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f76726f62696e2f63616c656e646172)](https://camo.githubusercontent.com/7933e453f8faca11ae68dd034c9067fd13c34492b031393eba8d7b6170d777c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f76726f62696e2f63616c656e646172)[![Packagist License](https://camo.githubusercontent.com/174b66caeedb72ca9cba3842ec714cfdf38b796e8b5ee8c89cdb11c565ba9cf9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f76726f62696e2f63616c656e646172)](https://camo.githubusercontent.com/174b66caeedb72ca9cba3842ec714cfdf38b796e8b5ee8c89cdb11c565ba9cf9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f76726f62696e2f63616c656e646172)[![Build Status](https://camo.githubusercontent.com/b7d9939b7c0955a0b5fbeea7ed917f8282370b490cc053df5fe219f39dfac3b0/68747470733a2f2f7472617669732d63692e636f6d2f6865616c74683930312f43616c656e6461722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/health901/Calendar)[![Version](https://camo.githubusercontent.com/72dc5e81cbdd504bac7ffd6187b54f074d79d076cc0dd8df9b51a8ec014876fa/68747470733a2f2f706f7365722e707567782e6f72672f76726f62696e2f63616c656e6461722f76657273696f6e)](//packagist.org/packages/vrobin/calendar)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

安装
--

[](#安装)

`composer require vrobin/calendar`

使用
--

[](#使用)

### 创建对象

[](#创建对象)

使用公历日期创建对象 日期格式参考`DateTime`类

```
Calendar::createFromSolar('1989-02-06 00:32')

```

使用农历日期创建对象 第四个参数为是否为闰月

```
Calendar::createFromLunar(1989, 3, 8, false)

```

### 获取属性

[](#获取属性)

获取公历数据

`solarDate` 方法返回一个`DateTime`对象,可使用`format`方法输出内容

例:

```
$calendar->solarDate()->format('Y-m-d');

```

获取农历数据

`lunarFormat` 通过格式字符串输出相应内容

输出生辰八字:

```
Calendar::createFromSolar('1989-02-06 00:32')->lunarFormat('TD年 rs月 ea日 wl时'); //己巳年 丙寅月 丁酉日 庚子时

```

输出农历日期:

```
Calendar::createFromSolar('2028-06-26')->lunarFormat('TD年 S Y月R'); //戊申年 猴 闰五月初四

```

符号格式表

符号描述示例y数字年1999m数字月4d数字日13T年天干甲D年地支子Y中文月正月R中文日初八S生肖牛r月天干甲s月地支子e日天干甲a日地支子X星座白羊j节气白露w时天干甲l时地支子

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~31 days

Total

3

Last Release

1796d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b7428ce1ff65927172cd6ef5ffd1c8c5ad55710bacf4565e1ee81acef1e250e?d=identicon)[health901](/maintainers/health901)

---

Top Contributors

[![health901](https://avatars.githubusercontent.com/u/1503105?v=4)](https://github.com/health901 "health901 (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bennettstone/magicmin

MagicMin is a PHP based javascript and stylesheet minification and merging class designed to generate minified, merged, and automatically updating files to simplify the process of minified file usage and updating when going between production and development environments.

495.4k](/packages/bennettstone-magicmin)

PHPackages © 2026

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