title: How to get current date without time?
body: <p>I'm trying to get the current date without the time and store it in a variable, within JavaScript. It needs to be without time as I'm converting it to an epoch date, with which I will use to measure the past 24 hours (if date is within 24 hours then it will be displayed). The problem is that with the added time, it doesn't match as within the last 24 hours.</p>
  
  <p>e.g. it returns the date as the following when converted to epoch: 1408704590485</p>
  
  <p>I want it to be like 1408662000000 </p>
  
  <p>I'm not to sure how to do this.</p>
  
  <p>Code - How the current days epoch date is currently being stored -  </p>
  
  <pre><code>var epochLoggingFrom;
  var epochLoggingTo;
  
  $(document).ready(function () {
      epochLoggingFrom = dateToEpoch(new Date());
      epochLoggingTo = dateToEpoch(new Date());
  }
  </code></pre>
  
  <p>dateToEpoch function - </p>
  
  <pre><code>function dateToEpoch(thedate) {
      return thedate.getTime();
  }
  </code></pre>