PHPackages                             kilofox/ephemeris - 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. kilofox/ephemeris

ActiveLibrary

kilofox/ephemeris
=================

千狐天文历

v0.1.1(5y ago)051MITPHPPHP ~7

Since Apr 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kilofox/ephemeris)[ Packagist](https://packagist.org/packages/kilofox/ephemeris)[ RSS](/packages/kilofox-ephemeris/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Kilofox Ephemeris
=================

[](#kilofox-ephemeris)

📅 千狐天文历是一款利用天文算法实现中国农历与公历无表查询的日历产品，可用于西元前1000年至西元3000年期间的日期转换。

Installing
==========

[](#installing)

```
$ composer require kilofox/ephemeris
```

Usage
=====

[](#usage)

```
use Kilofox\Ephemeris\Calendar;

$calendar = new Calendar;

// 阳历转阴历
$result = $calendar->solar2lunar(2021, 3, 19);

// 阴历转阳历
$result = $calendar->lunar2solar(2021, 2, 7);
```

结果：

```
array (
  'lunar_year' => 2021,
  'lunar_month' => 2,
  'lunar_day' => 7,
  'lunar_year_chinese' => '二零二一',
  'lunar_month_chinese' => '二月',
  'lunar_day_chinese' => '初七',
  'cstb_year' => '辛丑',
  'cstb_month' => '辛卯',
  'cstb_day' => '丙寅',
  'is_leap' => true,
)

array (
  'solar_year' => 2021,
  'solar_month' => 3,
  'solar_day' => 19,
  'solar_hour' => 18,
  'solar_minute' => 21,
  'solar_second' => 7,
)
```

更多 API 见源码。

Reference
=========

[](#reference)

- [基本算法参考](http://www.bieyu.com/)
- [中国历法 - 维基百科](https://zh.wikipedia.org/wiki/Category:%E4%B8%AD%E5%9B%BD%E5%8E%86%E6%B3%95)
- [农历 - 维基百科](https://zh.wikipedia.org/wiki/%E8%BE%B2%E6%9B%86)
- [阴历 - 维基百科](https://zh.wikipedia.org/wiki/%E9%98%B4%E5%8E%86)
- [阳历 - 维基百科](https://zh.wikipedia.org/wiki/%E9%98%B3%E5%8E%86)
- [干支 - 维基百科](https://zh.wikipedia.org/wiki/%E5%B9%B2%E6%94%AF)
- [星座 - 维基百科](https://zh.wikipedia.org/wiki/%E6%98%9F%E5%BA%A7)
- [生肖 - 维基百科](https://zh.wikipedia.org/wiki/%E7%94%9F%E8%82%96)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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 ~7 days

Total

2

Last Release

1838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88fd4018e1fe23be3bafa2162ec8e73edc7cdbabcf37747ae2c0080895218ea3?d=identicon)[muffetlab](/maintainers/muffetlab)

---

Tags

calendarChineselunarsolarsolar2lunarlunar2solar

### Embed Badge

![Health badge](/badges/kilofox-ephemeris/health.svg)

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

###  Alternatives

[overtrue/chinese-calendar

中国农历转换与查询工具

557103.7k4](/packages/overtrue-chinese-calendar)[azuyalabs/yasumi

The easy PHP Library for calculating holidays

1.1k11.4M25](/packages/azuyalabs-yasumi)[6tail/lunar-php

lunar是一款无第三方依赖的日历工具，支持公历(阳历)、农历(阴历、老黄历)、佛历和道历，支持星座、儒略日、干支、生肖、节气、节日、彭祖百忌、每日宜忌、吉神宜趋、凶煞宜忌、吉神(喜神/福神/财神/阳贵神/阴贵神)方位、胎神方位、冲煞、纳音、星宿、八字、五行、十神、建除十二值星、青龙名堂等十二神、黄道日及吉凶等。lunar is a calendar library for Solar and Chinese Lunar.

19326.3k4](/packages/6tail-lunar-php)[phpu/calendar

中国日历，通过天文计算和民间推算方法，准确计算出公历-1000年至3000年的农历、干支、节气等，同时支持多配置、多语言、多时区。

201.7k](/packages/phpu-calendar)[moe/full-calendar

A lightweight calendar module for Silverstripe. Implements the popular javascript http://fullcalendar.io/ library.

121.5k](/packages/moe-full-calendar)

PHPackages © 2026

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