//返回指定月份第天
function get_the_month_first_day_str($theyear, $themonth) {
date("Y-m-d", mktime(0, 0, 0, $themonth, 1, $theyear));
}
//返回指定月份最后天
function get_the_month_last_day_str($theyear, $themonth) {
$theday = date("t", mktime(0, 0, 0, $themonth, 1, $theyear));
date("Y-m-d", mktime(0, 0, 0, $themonth, $theday, $theyear));
}
//返回指定日期所在周第天(周日为第天周为第 2天以此类推)
function get_the_week_first_day_str($theyear, $themonth, $theday) {
$date = mktime(0, 0, 0, $themonth, $theday, $theyear);
$date = $date - (24 * 60 * 60 * date("w", $date));
date("Y-m-d", $date);
}
//返回指定日期所在周最后天(周日为第天周为第 2天以此类推)
function get_the_week_last_day_str($theyear, $themonth, $theday) {
$date = mktime(0, 0, 0, $themonth, $theday, $theyear);
$date = $date - (24 * 60 * 60 * date("w", $date)) + (24 * 60 * 60 * 6);
date("Y-m-d", $date);
}
最新评论