title: Calculate months diff between dates without days
body: <p>is there a good way to calculate months diff between dates without days? I mean I have two not full dates for example:
  2017-09 and 2018-11. I need to calculate how many months is between this two dates. I read something about this and I know I can for example use:</p>
  
  <pre><code>$firstDate = "2017-09";
  $secondDate = "2018-11";
  $firstDate = new DateTime($firstDate . "-01"); 
  $secondDate  = new DateTime($secondDate . "-01");
  $interval = date_diff($firstDate, $secondDate);
  
  var_dump($interval-&gt;format('%m months'));exit();
  </code></pre>
  
  <p>This show me 2 months.
   How can I reach this? And is there a way to calculate this without adding days "-01" to end of my dates?
  I want to calculate difference of months for dates without write "-01" in this dates. Only year and month.</p>