Karem
Karem

Reputation: 18103

Using next day in strtotime with PHP

It's monday and I run the following:

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

Which gives me date the of tomorrow, 08-07-2014

If i run

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

It provides me the same.

But how can i easiest get the next tuesday in the next week (not tomorrow)?

Upvotes: 1

Views: 75

Answers (3)

ashish.negi
ashish.negi

Reputation: 534

You can add days also to get desire result like :

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

Upvotes: 0

Rob
Rob

Reputation: 409

You can do the following

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

Upvotes: 1

hsz
hsz

Reputation: 152206

Just try with:

strtotime('this tuesday +1 week')

Upvotes: 3

Related Questions