title: Generate random date between two dates and times in Javascript
body: <p>I want to generate a random date between two dates and between two times in javascript. For instance I want to generate a random date (between 8 am and 6 pm) between today and next tomorrow. I have tried a whole bunch of things but none of them work so I won't be pasting any code since it does not work. Has anyone done something similar </p>
  
  <pre><code>function generateRandomDate(start, end) { 
      return new Date(start + Math.random() * (end - start)); 
  }
  </code></pre>
  
  <p>The code I am using for generating random dates is posted above</p>