首字母要大写、只能由字母和数字组成;一旦创建,不能修改!不能重复。
接口标题,概括性的标题说明。
接口功能说明,简短的一句话或一段话说明。
<?php
function ($params, $di) {
// 实例化
// 完整源代码请参考 https://github.com/kuif/common/blob/master/feng/Lunar.php
$lunar = new \App\Common\Lunar();
// 将阳历转换为阴历
$today = '2024-01-01';
$str = $lunar->convertSolarToLunar($today);
yesapi_debug($str);
// 判断是否是闰年
$year = 2024;
$isLeapYear = $lunar->isLeapYear($year);
yesapi_debug($isLeapYear);
// 获取干支纪年
$name = $lunar->getLunarYearName($year);
yesapi_debug($name);
// 根据阴历年获取生肖 猴,鸡,狗,猪,鼠,牛,虎,兔,龙,蛇,马,羊
$name = $lunar->getYearZodiac($year);
// 获取阳历月份的天数
// $lunar->getSolarMonthDays($year,$month);
// 获取阴历月份的天数
// $lunar->getLunarMonthDays($year,$month);
// 获取阴历每月的天数的数组
// $lunar->getLunarMonths($year);
// 获取农历每年的天数
// $lunar->getLunarYearDays($year);
// 获取闰月
// $lunar->getLeapMonth($year);
// 计算阴历日期与正月初一相隔的天数
// $lunar->getDaysBetweenLunar($year,$month,$date);
// 计算2个阳历日期之间的天数
// $lunar->getDaysBetweenSolar($year,$cmonth,$cdate,$dmonth,$ddate);
// 根据距离正月初一的天数计算阴历日期
// $lunar->getLunarByBetween($year,$between);
// 获取数字的阴历叫法
// $lunar->getCapitalNum($num,$isMonth);
// 节气通用算法
// $lunar->getSolarTerm($today);
// 根据节气获取季节
// $lunar->getSeason($today);
return 'ok';
}
xxxxxxxxxx
// 输出调试结果……
调试运行 PHP代码格式化 测试数据库管理 F11全屏(Esc退出) Ctrl+F 查找、Ctrl+Shift+F 逐个替换、Ctrl+Shift+R 全部替换 帮助:1)在测试环境可以预览接口文档,发布后才可以正式运行;2)源代码,目前只支持PHP,查看云函数(PHP)开发文档; 3、测试环境使用测试数据库,调试前请先手动 同步到测试环境;4)平台将严格保护你的云函数源代码,不向任何第三方透露;5)禁止编写恶意或违规的云函数。
回到顶部 ↑