WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to calculate a future date based on the date the post is published and use it in the content of a post.

I can echo the post publication date using:

echo the_date('Y-m-d');

How can I calculate the future date?

share|improve this question


$future_timestamp = strtotime('+1 week', get_the_date('Y-m-d'));

echo date('Y-m-d', $future_timestamp);


$future_timestamp = get_the_date('U') + (60 * 60 * 24 * 7);

echo date('Y-m-d', $future_timestamp);
share|improve this answer
One Trick Pony is my hero! Just what I needed, wanted and can use. Many, many thanks! – Kirk Ward Dec 10 '11 at 17:40
Then you should make his answer as accepted! – chrisguitarguy Dec 10 '11 at 17:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.