0

我遇到的问题是试图查找下周的星期三。

$next_wednesday = strtotime("next Wednesday 19:00:00"); 
$this_wednesday = strtotime("Wednesday 19:00:00");

$next_wednesday$this_wednesday出来的值相同

4

4 回答 4

2

在使用 strtotime 时尝试使用更具体的文本。

$this_wednesday = strtotime('Wednesday this week 19:00:00');
$next_wednesday = strtotime('Wednesday next week 19:00:00');
于 2013-06-27T06:44:44.027 回答
1

利用

$this_wednesday = strtotime("Wednesday 19:00:00");
$next_wednesday = strtotime("+1 week Wednesday 19:00:00");
于 2013-06-27T06:38:27.887 回答
1
<?php
$this_wednesday = strtotime("Wednesday 19:00:00");
$next_wednesday = strtotime('last Wednesday');

echo date('m/d/y h:i a',$this_wednesday) . "\n" . date('m/d/y h:i a',$next_wednesday);

查看演示

于 2013-06-27T06:48:09.273 回答
1
    <?php
    $year = 2013;
    $month = 7;
    $day = 5;


    echo date("F j, Y, g:i a",strtotime('next Wednesday')).'<br>';

    echo date("F j, Y, g:i a",strtotime('next 

    Wednesday',mktime(0,0,0,$month,$day,$year)));

   ?>
于 2013-06-27T07:02:25.470 回答