Add date in php gives different results
<p>I have to get a date which is 6 months added with specific date.
I used the following code</p>

<pre><code>$start_date = "2016-08-30";
$end_date= date( "Y-m-d", strtotime( "$start_date +6 months" ) );
echo $end_date;
</code></pre>

<p>which gave result as 2017-03-02
<br>
Then I changed the start date in code as below</p>

<pre><code>$start_date = "2016-09-01";
$end_date= date( "Y-m-d", strtotime( "$start_date +6 months" ) );
echo $end_date;
</code></pre>

<p>which is giving result as 2017-03-01
<br>
Why is this happening at first place? Is there anything wrong with my code?
<br>
Using Mysql query </p>

<pre><code>SELECT DATE_ADD('2016-08-30', INTERVAL 6 MONTH)
</code></pre>

<p>gives result 2017-02-28
<br>
Which is the right solution to get the correct date?</p>