title: Calculation of Late Arrival / Early Arrival From In / Out Time
body: <p>I have table - attendance </p>
  
  <pre><code>staff_id |   in_date  |  out_date  | shift_in | shif_out | in_time  | out_time 
      1      2013-09-10   2013-09-10   06-30-00   15-00-00   07-00-00   15-00-00
      2      2013-09-10   2013-09-11   20-00-00   06-00-00   19-00-00   06-00-00
      3      2013-09-10   2013-09-11   23-00-00   06-00-00   23-30-00   07-00-00
  </code></pre>
  
  <p>I need to get result as </p>
  
  <pre><code>staff_id | late_time | early_time | extra_time 
      1      00-30-00    00-00-00     00-00-00
      2      00-00-00    01-00-00     00-00-00
      2      00-30-00    00-00-00     01-00-00
  </code></pre>
  
  <p>Can I achieve the result from mysql query itself or Do I need to use PHP to calculate this ? How can I get this result ?</p>