title: Java 8 Time API / Is current time in time frame
body: <p>I would like to check if the current time is in a defined frame. I tried the following:</p>
  
  <pre><code>if (LocalTime.now().isBefore(config.getEnd()) &amp;&amp; LocalTime.now().isAfter(config.getStart())) {
      ...
  }
  </code></pre>
  
  <p><code>config.getEnd()</code> and <code>config.getStart()</code> return <code>LocalTime</code>s in the format "HH:mm:ss".</p>
  
  <p>This works as long as the starttime is before the endtime. But if this program should execute in the middle of the night between 23:00:00 and 02:00:00 then of course it doesn't. With the old java.util.date I would deduct 1 day from the starttime but I have no days here.</p>
  
  <p>Does anyone know an elegant solution to this?</p>