Reputation: 2303
The problem I'm having is in trying to look up wednesday of next week.
$next_wednesday = strtotime("next Wednesday 19:00:00");
$this_wednesday = strtotime("Wednesday 19:00:00");
The values for $next_wednesday
and $this_wednesday
come out the same
Upvotes: 0
Views: 792
Reputation: 11
<?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)));
?>
Upvotes: 1
Reputation: 3907
<?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);
See the Demo
Upvotes: 1
Reputation: 57002
try using more specific texts when using strtotime.
$this_wednesday = strtotime('Wednesday this week 19:00:00');
$next_wednesday = strtotime('Wednesday next week 19:00:00');
Upvotes: 2
Reputation: 22972
Use
$this_wednesday = strtotime("Wednesday 19:00:00");
$next_wednesday = strtotime("+1 week Wednesday 19:00:00");
Upvotes: 1