Jump to content

Archived

This topic is now archived and is closed to further replies.

Woodburn2006

dates

Recommended Posts

if i have a variable with a number of days e.g. 20. is there any way of adding that number to a date so that we get a new date.

for example if i start with 2006/04/20 i would add 20 to it and end up with 2006/05/10.

is there any way of doing this?

Share this post


Link to post
Share on other sites
[code]<?php
$date = '2006/04/20';
$addDays = 20

echo date ('Y/m/d', strtotime ("$date + $addDays days"));

?>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.