title: check if "current time" is between 2 times. But also check for nights as the day before
body: <p>I have 2 times for example: 10:00 and 1:00 now i want to check if current time... is between these 2 times in javascript.</p>
  
  <p>The problem is that the closing time in this case is a next day so its before the openingstime. How can i do this the proper way for some reason i can not get around this.</p>
  
  <p>i hav efound that this could solve it:</p>
  
  <pre><code>    var start = new Date(2012,6,20,13).getTime();
  var now = new Date().getTime();
  var end = new Date(2012,6,21,2).getTime();
  
  if( (start &lt; now ) &amp;&amp; (now &lt; end )) {
    console.log("opened");
  }
  else {
   console.log("closed");
  }
  </code></pre>
  
  <p>but how can i do it with 2 string formats like 10:00 and 2:00 because i do not see a option to put a time alone</p>
  
  <pre><code>var d = new Date();
  var d = new Date(milliseconds);
  var d = new Date(dateString);
  var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);
  </code></pre>