我遇到的问题是试图在下周三的星期三看。
$next_wednesday = strtotime("next Wednesday 19:00:00");
$this_wednesday = strtotime("Wednesday 19:00:00");
$next_wednesday
和$this_wednesday
的值相同
答案 0 :(得分:2)
在使用strtotime时尝试使用更具体的文本。
$this_wednesday = strtotime('Wednesday this week 19:00:00');
$next_wednesday = strtotime('Wednesday next week 19:00:00');
答案 1 :(得分:1)
使用
$this_wednesday = strtotime("Wednesday 19:00:00");
$next_wednesday = strtotime("+1 week Wednesday 19:00:00");
答案 2 :(得分: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);
请参阅Demo
答案 3 :(得分: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)));
?>