title: How to get the time since midnight in seconds
body: <p>First off, this is a simple question that I'm stuck on in my Java 1 class.  It's a static time that I set already as 8:49:12 "today" and I'm to figure out how many seconds past midnight and "to" midnight this represents.  8 hours, 49 minutes, and 12 seconds.
  Here is my code now:</p>
  
  <pre><code>hour    = 8;
  minute  = 59;
  second  = 32;
  System.out.println("The static time used for this program was: " + hour + ":" + minute + ":" + second);
  </code></pre>
  
  <p>My issue is that I have no clue on how to get the time <strong>from</strong> and <strong>since</strong> midnight.</p>
  
  <p>So basically the output needs to be:</p>
  
  <pre><code>Number of seconds since midnight: 
  Number of seconds to midnight:
  </code></pre>
  
  <p>And the space after is for the seconds.</p>
  
  <p>Thanks, and please explain why, and how you chose how to solve this.  I want to learn :P</p>