PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2017-08-23 (3 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 11 All time: 9,096 This week: 531Up
Version License PHP version Categories
chinese-lunar-calend 1.0Custom (specified...5PHP 5, Time and Date
Description Author

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.

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
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.

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

Manuel Lemos
  Performance   Level  
Name: Peter Kahl <contact>
Classes: 32 packages by
Country: Hong Kong Hong Kong
Age: ???
All time rank: 6584 in Hong Kong Hong Kong
Week rank: 32 Up1 in Hong Kong Hong Kong Up
Innovation award
Innovation award
Nominee: 19x

Details

Chinese Lunar Calendar

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)
}
*/
  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 README.md 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  
 100%
Total:11
This week:0
All time:9,096
This week:531Up