title: How to convert a specific time to milliseconds
body: <p>How can I convert one specific hour, e.g. 18:00, to milliseconds?</p>
  
  <p>I need this so that if it's between for example 12:00 and 18:00 I can do something, and if it is not between 12:00 and 18:00 I can do something else.</p>
  
  <p>I get the current time with:</p>
  
  <pre><code>Private long time;
  time = System.currentTimeMillis();
  </code></pre>
  
  <p>But I don't know how to convert an hour to milliseconds.</p>
  
  <p>I searched on the Internet and it seems that if I use <code>System.currentTimeMillis()</code> it will give me the millisecond of the current day and hour but I need it to update for every day something like this:</p>
  
  <p>Today the time in millis is something like this: <code>1516994140294</code>. But this number contains this: <code>Fri Jan 26 2018 19:15:40</code>. So if I use the millis for 12:00 and 18:00 of this day this means that tomorrow it will not work as I want.</p>
  
  <p>So can you help me with an example or documentation? Everything can help me :) and thanks in advance.</p>