title: HIVE - Format of time difference
body: <p>I want to calculate the difference between to events. Both events are stored in the UNIX_TIMESTAMP in miliseconds. </p>
  
  <p>Here is an example: 1464740049000</p>
  
  <p>How can I convert the time difference and format them in hours.</p>
  
  <p>I tried several things like datediff and/or timestamp(event1) - timestamp(event2).</p>
  
  <p>What I want is</p>
  
  <blockquote>
    <p>select timestamp(e1.time), timestamp(e2.time), e1.time-e2.time as
    Time_Diff from testdata;</p>
  </blockquote>
  
  <p>Time_Diff should be formatted in hours, minutes, seconds... 
  How can I get this?
  Thanks in advance
  Peter</p>