<?php
declare (strict_types = 1);

// 这是自定义的公共文件
use think\Log;



//获取某月天数
function getDaysOfMonth($days)
{
    $date = new \DateTime("{$days}-01");
    $days = $date->format('t');
    return $days;
}


//获取某年多少天
function getDaysOfYear($year)
{
    $year = intval($year);
    if ($year % 400 == 0 || ($year % 4 == 0 && $year % 100 != 0)) {
        return 366;
    }
    return 365;
}


function getNextWeekDates($date,$day) {
	// 定义日期
    $formats = [7 => 'sunday', 1 => 'monday', 2 => 'tuesday', 3 => 'wednesday', 4 => 'thursday', 5 => 'friday', 6 => 'saturday'];
	$nextWeekDate = date('Y-m-d', strtotime("next $formats[$day]", strtotime($date)));
    return $nextWeekDate;
}



