function get_time($y = "", $m = ""){
if ($y == "") $y = date("Y");
if ($m == "") $m = date("m");
$m = sprintf("%02d", intval($m));
$y = str_pad(intval($y), 4, "0", STR_PAD_RIGHT);
$m>12 || $m<1 ? $m=1 : $m=$m;
$firstday = strtotime($y . $m . "01000000");
$firstdaystr = date("Y-m-01", $firstday);
$lastday = strtotime(date('Y-m-d 23:59:59', strtotime("$firstdaystr +1 month -1 day")));
return array(
"firstday" => $firstday,
"lastday" => $lastday
);
}
获取某个月份的开始和结束时间戳
Je suppose que tu aimes
Origine blog.csdn.net/loveyoulouyou/article/details/105441001
conseillé
Classement