sarmenhbbb
sarmenhbbb

Reputation: 23

how do i display a date that is 2 weeks after a set date?

If I have a date such as 10/10/10, how do I display the date (in date format) 2 weeks after that? I think it has to do with strtotime, but I don't know how to write it. I'm looking at the php.net site and can't figure it out.

Upvotes: 2

Views: 1210

Answers (2)

Nathan H
Nathan H

Reputation: 49421

I'm not 100% what you need, but we'll give it a try:

$defaultTime = strtotime('+2 week',strtotime('10/10/10'));

Upvotes: 1

mpen
mpen

Reputation: 283043

Try this

date('y/m/d', strtotime('+2 weeks', strtotime('10/10/10')));

Upvotes: 4

Related Questions