title: Rails 5 how to save difference in hour and minutes between two datatime in postgres?
body: <p>my table has 3 columns: data type timestamp,</p>
  
  <pre><code>|created_At  |  final_time| duracion(difference between created at and final_time)
  |            |            |
  </code></pre>
  
  <p>the column difference should save the difference in hours and minutes, in this format HH:MM</p>
  
  <p>this is my controller:</p>
  
  <pre><code>def horario
    horario.update(duracion: params[:duracion]) // this params is "00:59"
  end
  </code></pre>
  
  <p>but in the table Horarios, in column duracion i have this:</p>
  
  <pre><code>2017-12-24 03:59:00 
  </code></pre>
  
  <p>so i want to save 00:59 (59 minutes) but postgres save all current date and add 3 hours more.
  i want to save so in the future i will be able tu sum column duracion. Or should i change data type for this column? In this case which datatype you recomend me for rails to save HH:MM??</p>
  
  <p>thanks.</p>