title: Convert time to seconds
body: <p>What the best way to convert 24 hours time to seconds so it can be used for comparison if statement..</p>
  
  <pre><code>function HourMinuteToDecimal($hour_minute) {
          $t = explode(':', $hour_minute);
          return $t[0] * 60 + $t[1];
  }
  
  echo HourMinuteToDecimal("23:30");
  return 1410
  </code></pre>
  
  <p>If you try to convert midnight time (00:00) to seconds, it will not work.  What is the solution to this? </p>
  
  <p>00:00, 00:30, 01:00, 01:30, etc.</p>
  
  <pre><code>if (HourMinuteToDecimal("01:30") &gt; HourMinuteToDecimal("23:30")) { .. } 
  </code></pre>
  
  <p>This will not work.</p>