title: Check if a date is 24 hours old
body: <p>I have a created date. I want to run an if/switch statement to know whether the date and time right now is more than 24 hours from the created date.</p>
  
  <p>If the created date is more than 24 hours ago, do something, if it's less than 24 hours ago do something else.</p>
  
  <pre><code>let now = +new Date();
  
  // This is returned as: July 18, 2018 at 3:48:00 AM UTC+1
  let createdAt = +doc.data().created_at;
  
  const oneDay = 60 * 60 * 24;
  var compareDatesBoolean = (now - createdAt) &gt; oneDay;
  </code></pre>
  
  <p>Any guidance here would be great thank you! :)</p>