可能重复: how to find first day of the next month and remain days to this date with php
我要把这个拿到本月的第一天
$_SERVER['dataInicio'] = date('Y') . "-" . date('m') . "-" . "1";下个月的第一天我需要一些类似的东西
发布于 2012-11-16 18:05:39
这似乎是一个重复或类似的帖子,为下个月的这个。
但是在接下来的一个月里,如果你想使用strtotime的话
date("m/l/Y", strtotime(date('m', strtotime('+1 month')).'/01/'.date('Y').' 00:00:00'));这个会回来的
12/周六/2012如果你想要的话,只需将日期格式设置为l(小写L)。
date("l", strtotime(date('m', strtotime('+1 month')).'/01/'.date('Y').' 00:00:00'));
How to find first day of the next month and remaining days till this date with PHP
或者这个
In PHP, is there an easy way to get the first and last date of a month?
发布于 2012-11-16 18:57:27
$date = new DateTime('now');
$date->modify('first day of next month');
echo $date->format('D') . '\n';
$date->modify('first day of this month');
echo $date->format('D') . '\n';发布于 2012-11-16 18:08:03
$_SERVER['dataInicio'] = date('Y-m-d', mktime(0, 0, 0, date('m')+1, 1, date('Y')));做你想做的事。
https://stackoverflow.com/questions/13422032
复制相似问题