事情就是这么简单,我正在处理一些事情,目前它与日期有关……所以我有这个……
$day = date('d',strtotime("+0 days"));
$month = date('M',strtotime("+0 days"));
$year = date('Y',strtotime("+0 days"));
$date = $day.'/'.$month.'/'.$year;
$echo $date;这是没有问题的。但是在尝试添加/外卖天数的时候,我就遇到了问题。当我这样做的时候..
$day = date('d',strtotime("+1 days"));
$month = date('M',strtotime("+1 days"));
$year = date('Y',strtotime("+1 days"));
$date = $day.'/'.$month.'/'.$year;我再一次知道问题,我可以添加每隔多少天就有多少个问题,但当我减去几天时,我可以减去1,2,5,6,7,8,9等等。离开几天,但试着离开三四天,就像...
$day = date('d',strtotime("-3 days"));
$month = date('M',strtotime("-3 days"));
$year = date('Y',strtotime("-3 days"));
$date = $day.'/'.$month.'/'.$year;它不需要那么多天,只需要从当前日期减少1天即可。有人能解释为什么会发生这种情况吗?为什么我不能从当前日期开始只休息3-4天呢?
发布于 2014-02-15 17:34:46
尝尝这个
$now = date("d/M/Y");
$newDate = date("d/M/Y", strtotime('-3 day'.$now));你可以在上面的一行中做所有的事情,而不是分开几天,几个月。
https://stackoverflow.com/questions/21795725
复制相似问题