title: MYSQL Calculate date difference in digital time format
body: <p>In one of the table I have 2 columns name <strong>date1</strong> and <strong>date2</strong> having <strong>datetime</strong> data type</p>
  
  <p>I am calculating difference between these two dates using <code>timediff(date2,date1)</code>. Now suppose</p>
  
  <p><code>date1=2018-04-05 13:10:00
  date2=2018-04-05 14:40:00</code></p>
  
  <p>then the difference between these two dates will be <code>01:30:00</code></p>
  
  <p>MY MAIN QUESTION IS how to convert this <code>H:i:s</code> time to digital time format like <code>01:30:00=1.5</code> or <code>01:45:00=1.75</code>?</p>