PHP Classes

Chinese Lunar Calendar: Convert Gregorian date to Chinese lunisolar

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 113 All time: 9,590 This week: 84Up
Version License PHP version Categories
chinese-lunar-calend 1.0.0Custom (specified...5PHP 5, Time and Date


This class can convert Gregorian date to Chinese lunisolar.

It can take a date in the Gregorian calendar and converts it to the Chinese Lunisolar calendar.

It also returns the Chinese zodiacal sign for a given date like for instance tiger, dragon, etc..

The class can also do the opposite, i.e. convert a date in the Lunisolar calendar and convert to the Gregorian calendar.

Innovation Award
PHP Programming Innovation award nominee
September 2017
Number 6
Eastern cultures use the Gregorian calendar to specify dates of events of the day, or in the past and the future. The Chinese culture uses the Lunisolar calendar instead.

This class convert dates between the Gregorian and Lunisolar calendars.

Manuel Lemos
Picture of Peter Kahl
  Performance   Level  
Name: Peter Kahl <contact>
Classes: 37 packages by
Country: United Kingdom
Age: ???
All time rank: 41721 in United Kingdom
Week rank: 286 Up10 in United Kingdom Up
Innovation award
Innovation award
Nominee: 23x

Winner: 2x


Chinese Lunar Calendar

Downloads Download per Month License If this project has business value for you then don't hesitate to support me with a small donation.

Converts from Gregorian date to Chinese lunisolar date and vice versa. Accepts dates between the years 1900-2100.


use peterkahl\Lunar\Lunar;

$gregorianDate = '2017-08-23';

$chineseDate = Lunar::Gregorian2Lunar($gregorianDate);

array(7) {
  string(12) "????"
  string(12) "????"
  string(12) "????"
  string(5) "07-02"

$chineseDate = '2017-07-2';

$gregorianDate = Lunar::Lunar2Gregorian($chineseDate);


array(3) {

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file Lunar.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,590
This week:84Up