I want to add number of days to current date: I am using following code:
$i=30;
echo $date = strtotime(date("Y-m-d", strtotime($date)) . " +".$i."days");
But instead of getting proper date i am getting this: 2592000
Please suggest.
I want to add number of days to current date: I am using following code:
$i=30;
echo $date = strtotime(date("Y-m-d", strtotime($date)) . " +".$i."days");
But instead of getting proper date i am getting this: 2592000
Please suggest.
You can use strtotime()
$data['created'] = date('Y-m-d H:m:s', strtotime('+1 week'));
Simple and Best
Try this
You can do it by manipulating the timecode or by using strtotime(). Here's an example using strtotime.
Keep in mind, the change of clock changes because of daylight saving time might give you some problems when only calculating the days.
Here's a little php function which takes care of that:
You may try this.