avexsoft/chinese-lunar-calendar
Composer 安装命令:
composer require avexsoft/chinese-lunar-calendar
包简介
Converts from Gregorian date to Chinese lunisolar date and vice versa.
README 文档
README
Converts from Gregorian date to Chinese lunisolar date and vice versa. Accepts dates between the years 1900-2100.
Notice
This was cloned from the now abandoned https://github.com/peterkahl/chinese-lunar-calendar as our attempts to reach him failed. Avexsoft is committed to maintaining this, PRs welcomed.
Usage
use Avexsoft\Lunar\Lunar; $gregorianDate = '2017-08-23'; $chineseDate = Lunar::Gregorian2Lunar($gregorianDate); /* array(7) { ["y"]=> int(2017) ["m"]=> int(7) ["d"]=> int(2) ["leap"]=> bool(false) ["zh-cn"]=> string(12) "七月初二" ["zh-hk"]=> string(12) "七月初二" ["ja"]=> string(12) "七月初二" ["en"]=> string(5) "07-02" } */ #------------------------------------------------- $chineseDate = '2017-07-2'; $gregorianDate = Lunar::Lunar2Gregorian($chineseDate); var_dump($gregorianDate); /* array(3) { ["y"]=> int(2017) ["m"]=> int(8) ["d"]=> int(23) } */
统计信息
- 总下载量: 69
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2021-03-22