title: How to determine if the specific time is between given time range in javascript
body: <p>i want to check var check_val   in between two time  var open_time and var close_time</p>
  
  <pre><code>var open_time  = "23:30";
  var close_time = "06:30";
  var check_val  ="02:30";
  if(Date.parse ( check_val ) &gt; Date.parse ( open_time ) &amp;&amp; Date.parse ( check_val ) &lt; Date.parse ( close_time )){
      var flag=1;
  } else { 
      var flag=2
  }
  </code></pre>
  
  <p>the result is always else part</p>