peterkahl / chinese-lunar-calendar
This package is abandoned and no longer maintained.
No replacement package was suggested.
Converts from Gregorian date to Chinese lunisolar date and vice versa.
v1.0.1
2018-03-22 15:21 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2021-01-02 17:58:32 UTC
README
Converts from Gregorian date to Chinese lunisolar date and vice versa. Accepts dates between the years 1900-2100.
Usage
use peterkahl\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) } */