Skip to content

公历转农历,Converting the Gregorian Calendar into the Lunar Calendar

Notifications You must be signed in to change notification settings

zhuqiyang/convertSolarToLunar-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

convertSolarToLunar

公历转农历,Converting the Gregorian Calendar into the Lunar Calendar

ThinkPHP中的使用方法:

先将文件放入 ThinkPHP/Library/Org/Util 中,然后在控制器中使用 import 函数导入即可。
public function demo()
{
	import('Org.Util.DateConvert');
	$DateConvert = new \DateConvert();

	$date = explode('-',date('Y-m-d'));
	$lunar = $DateConvert->convertSolarToLunar($date[0], $date[1], $date[2]);
	dump($lunar);
}

原生PHP的使用方法:

require("DateConvert.class.php");
$DateConvert = new DateConvert();

$date = explode('-',date('Y-m-d'));
$lunar = $DateConvert->convertSolarToLunar($date[0], $date[1], $date[2]);
var_dump($lunar);

About

公历转农历,Converting the Gregorian Calendar into the Lunar Calendar

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages