使用第二天的strtotime与PHP


Using next day in strtotime with PHP

今天是星期一,我执行了以下命令:

$d = date('d-m-Y', strtotime('this tuesday'));

给我明天的日期,08-07-2014

如果我运行

$d = date('d-m-Y', strtotime('next tuesday'));

它提供给我相同的。

但是我怎样才能最容易地得到下周的下个星期二(而不是明天)?

试试:

strtotime('this tuesday +1 week')

您可以执行以下操作

$d = date('d-m-Y', strtotime('next week tuesday'));

您还可以添加天数以获得期望的结果,如:

date('Y-m-d', strtotime('this tuesday +7 days'));