strtotime("next Wednesday")

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

strtotime("next Wednesday")

Post by Shendemiar »

return date("Y-m-d H:i:s", strtotime("next Wednesday"));

returns 2004-03-10 00:00:00

thats almost two weeks ahead.

So is there an easy way to get the timestamp of next wednesday (any other weekday), or should i reinvent the wheel?
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

Date gives the dayof week as a number from 0 to 6, i made a small function with that.
Post Reply