title: How to compare timestamps in Ruby
body: <p>What is the  simplest way to achieve this in Ruby?</p>
  
  <p>I have two strings:</p>
  
  <pre><code>a = "08:02:04.982"
  b = "10:07:12.004"
  </code></pre>
  
  <p>I need to convert each string to a date object then compare to ensure that <code>b</code> is greater (later) than <code>a</code>. Such as:</p>
  
  <pre><code>if b &gt; a
    print "this is normal"
  else 
    print "this is not normal"
  end
  </code></pre>
  
  <p>I tried using:</p>
  
  <pre><code>Time.parse("08:02:04.982")
  </code></pre>
  
  <p>but that insisted on returning a date.</p>
  
  <p>So I tried:</p>
  
  <pre><code>Time.parse("08:02:04.982", "%H:%M:%S.%3N")
  </code></pre>
  
  <p>but that complains about undefined method "year". </p>