Download the PHP package phpu/calendar without Composer

On this page you can find all versions of the php package phpu/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 calendar

日历

calendar、日历、中国农历、阴历、节气、干支、生肖、星座

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

天文计算方法参考Jean Meeus的《Astronomical Algorithms》、NASA网站、天文与历法网站等相关的天文历法计算方法。

Installation 安装

示例

日历

日历默认时区是: Asia/Shanghai

上例代码:

日历配置

config.php

引入配置:

引入语言:

语言文件中在设置时区名称,引入语言后自动设置了时区

设置时区:

如果需要单独设置时区:

儒略日与公历互换

Julian

儒略日转换为日期时间(TT):

日期时间(TT)转换为儒略日:

简化儒略日MJD

简化儒略日计算1858年11月16日午夜之后的日期

节气

SolarTerm

显示一整年的节气,同时显示上一年最后一个气(冬至)和下一年第一个节(小寒)

如2021年全年节气显示如下:

取节气测试代码:

农历与公历互换

农历中文数字表示参考下面的两个函数

农历中文数字表示可以参考以下两个函数

以下两个函数在Calendar类中作为私有方法存在,因此在日历显示时会根据语言自动转换

公历转换干支生肖

生肖依地支为引索

星座


All versions of calendar with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
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 phpu/calendar contains the following files

Loading the files please wait ....