jetfueltw / solarlunar-php
Chinese solar lunar calendar converter
v1.0.1
2019-12-18 06:23 UTC
Requires
- php: >=7.2
Requires (Dev)
- guzzlehttp/guzzle: ^6.5
- nesbot/carbon: ^2.27
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2026-03-09 01:04:12 UTC
README
公曆(阳历)、農曆(阴历)轉換,支援時間從 1900-01-01 到 2099-12-31。
基於 https://github.com/isee15/Lunar-Solar-Calendar-Converter
有更好的 PSR 與 Composer 支持。
Installation
composer require jetfueltw/solarlunar-php
use Jetfuel\SolarLunar\SolarLunar;
Useage
公曆轉農曆
$solar = Solar::create(2015, 1, 15); $lunar = SolarLunar::solarToLunar($solar); // Lunar { // "year" => 2014, // "month" => 11, // "day" => 25, // "isLeap" => false // }
農曆轉公曆
$lunar = Lunar::create(2014, 11, 25, false); $solar = SolarLunar::lunarToSolar($lunar); // Solar { // "year" => 2015, // "month" => 1, // "day" => 15 // }