title: DateTime subtraction in ruby 2?
body: <p>I need to subtract two <code>DateTime</code> objects in order to find out the difference in hours between them.</p>
  <p>I try to do the following:</p>
  <pre><code>a = DateTime.new(2015, 6, 20, 16)
  b = DateTime.new(2015, 6, 21, 16)
  puts a - b
  </code></pre>
  <p>I get <code>(-1/1)</code>, the object of class <code>Rational</code>.</p>
  <p>So, the question is, how do I find out what the difference betweent the two dates is? In hours or days, or whatever.</p>
  <p>And what does this <code>Rational</code> mean/represent when I subtract DateTimes just like that?</p>
  <h3>BTW:</h3>
  <p>When I try to subtract <code>DateTime</code>'s with the difference of 1 year, I get <code>(366/1)</code>, so when I do <code>(366/1).to_i</code>, I get the number of days. But when I tried subtracting two  <code>DateTime</code>'s with the difference of 1 hour, it gave me <code>-1</code>, the number of hours. So, how do I also find out the meaning of the returned value (hours, days, years, seconds)?</p>