Download the PHP package overtrue/chinese-calendar without Composer

On this page you can find all versions of the php package overtrue/chinese-calendar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chinese-calendar

Chinese calendar

CI Latest Stable Version Total Downloads License

:date: 中国农历(阴历)与阳历(公历)转换与查询工具。

特性

环境要求

版本 PHP 要求 分支 说明
2.x >= 8.5 master 当前开发版本
1.x >= 5.5.9 1.x 仅接受缺陷修复

安装

使用

返回结果:

常用 API

方法 说明
solar($year, $month, $day, $hour = null) 公历转农历,返回完整信息数组
lunar($year, $month, $day, $isLeapMonth = false, $hour = null) 农历转公历,返回完整信息数组
solar2lunar($year, $month, $day, $hour = null) 公历转农历(仅农历信息)
lunar2solar($year, $month, $day, $isLeapMonth = false) 农历转公历(仅公历年月日)
leapMonth($year) / leapDays($year) 某农历年闰几月 / 闰月天数
lunarDays($year, $month) / daysOfYear($year) / monthsOfYear($year) 农历月天数 / 年总天数 / 年总月数
solarDays($year, $month) 公历某月天数
getTerm($year, $no) 某年第 n 个节气(1 = 小寒)的公历日
diffInDays($lunar1, $lunar2, $absolute = true) 两个农历日期相差的天数(同类还有 diffInMonths / diffInYears)
addDays / subDays / addMonths / subMonths / addYears / subYears 农历日期加减

更多 API 请查看源码。

约定与注意事项

测试

从 1.x 升级

2.0 的计算结果与 1.1.0 完全一致,但有以下不兼容变更:

参考资料

License

MIT


All versions of chinese-calendar with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package overtrue/chinese-calendar contains the following files

Loading the files please wait ...