 <p>The date format provided is insufficient to do parsing.</p> <p>Ruby can parse string dates so long as the format complies with certain rules.</p> <p>While using hyphens <code>-</code>, inclusion of a day is mandatory.</p> <p>This is because typically hyphenated date formats include the day.</p> <p>Fortunately, if you're willing or able to change the format you can do the following:</p> <pre><code>date = '2016/6' DateTime.parse(date) =&gt; Wed, 01 Jun 2016 00:00:00 +0000 </code></pre> <p>Otherwise I would just append the first to your dates.</p> <pre><code>date = '2016-6' + '-1' DateTime.parse(date) =&gt; Wed, 01 Jun 2016 00:00:00 +0000 </code></pre> <p>Now you can do typical comparison stuff:</p> <pre><code>date1 = ... date2 = ... case date1 &lt;=&gt; date2 when -1 # date1 is before date2 when 1 # date1 is after date2 when 0 # date1 is equal to date2 </code></pre>