PHP:
$days
= cal_days_in_month(CAL_GREGORIAN, 4, 2011);
echo
"返回2011-4的天数 "
.
$days
.
"<br/>"
;
$days
=
date
(
‘t‘
,
strtotime
(
"2011-4-1"
));
echo
"返回2011-4的天数 "
.
$days
.
"<br/>"
;
$days
=
date
(
"t"
);
echo
"当前月的天数 "
.
$days
.
"<br/>"
;
MYSQL:
select DAYOFMONTH(last_day(‘2016-03-26‘));
时间: 2024-09-15 19:57:56