📅  最后修改于: 2022-03-11 14:54:00.480000             🧑  作者: Mango
function sumDays($days = 0, $format = 'd/m/Y') {
$incrementing = $days > 0;
$days = abs($days);
$actualDate = date('Y-m-d');
while ($days > 0) {
$tsDate = strtotime($actualDate . ' ' . ($incrementing ? '+' : '-') . ' 1 days');
$actualDate = date('Y-m-d', $tsDate);
if (date('N', $tsDate) < 6) {
$days--;
}
}
return date($format, strtotime($actualDate));
}