title: Ruby: Calculate time difference between 2 times
body: <p>I want to calculate the difference between 2 times.
  start_time: 22:00 (Rails interprets this as 2015-12-31 22:00:00 +0100)
  second_time: 02:00 (Rails interprets this as 2015-12-31 02:00:00 +0100). The second time is 4 hours later, so in the next day. Is there a way to calculate this difference?</p>
  
  <p>I can not simply do this: second_time - first_time, because this gives me a difference of 22 hours instead of 4 hours.</p>
  
  <p>Edit:
  <strong>Some background information:</strong>
  A job is starting at 22:00 and ending the next day at 02:00. Because i fill in the form of this job only times, this times for the above 2 values are 2015-12-31 22:00:00 +0100 and 2015-12-31 02:00:00 +0100. I don't want the user to fill in the time including the date. The real difference between the times should be 4 hours.</p>
  
  <p>So what i actually want is calculate the difference between 22:00 and 02:00 (in the next day).</p>