// 返回当前月第一天和最后一天
function getthemonth($date)
{
$firstday = date('Y-m-01', strtotime($date));
$lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day"));
return array($firstday,$lastday);
}
//使用
$today = date("Y-m-d");
$day=getthemonth($today);
echo "当月的第一天: ".$day[0].' 00:00:00.000'." 当月的最后一天: ".$day[1].' 23:59:59:998';
echo "<br/>";
exit;
Sqlserver:datetime类型的精度(不确定性)问题
https://www.cnblogs.com/password1/p/6994601.html
PHP获取当月天数及当月第一天及最后一天(计划任务常用)
https://blog.csdn.net/qq_42154707/article/details/86503662
网友评论