https://xxyh.xiaoli.icu/api/p_datecalc.phphttps://xxyh.xiaoli.icu/api/p_datecalc.php?start=2026-11-22&end=2027-01-01&add=30start 不传默认今天。传 end 返回相差天数、周数、工作日数与近似月数;传 add 返回加减 N 天后的日期,以及跳过周末后的工作日日期。
工作日只排除周六周日,不处理法定节假日调休,涉及考勤结算时请再叠加节假日表。
星期用中文输出,方便直接拼到文案里。
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
start |
string | 选填 | 2026-11-22 | 开始日期,默认今天 |
end |
string | 选填 | 2027-01-01 | 结束日期,可空 |
add |
string | 选填 | 30 | 加减天数,可负数 |
https://xxyh.xiaoli.icu/api/p_datecalc.php
此处将显示接口返回结果…
{
"code": 200,
"msg": "ok",
"data": {
"start": "2026-11-22",
"start_weekday": "星期日",
"end": "2027-01-01",
"days": 40,
"weeks": 5.71,
"workdays": 29,
"add_days": { "days": 30, "result": "2026-12-22" },
"add_workdays": "2027-01-01"
}
}
—