title: If Date is Less Than Current Date by 15mins then do something
body: <p>I have been trying to work on something with dates and I was wondering how to check if it is less than 30mins or 15mins difference then should call a function.</p>
  <pre><code>let btnCheck = document.querySelector('button');
  let result = document.querySeletor('h1');
  
  let current = new Date();
  let date = new Date('01/01/2021');
  
  btnCheck.addEventListener('click', () =&gt; {
  let ms1 = current.getTime();
  let ms2 = date.getTime();
  
  result.innerText = ms2 &lt; ms1;
  });
  </code></pre>
  <p>So far it results in a true or false but I wanted to add something if the current date is less than the date by 15mis or 30 mins show a button.</p>
  <p>Update: Using Moment Library it can be possible through something like this: <a href="https://momentjs.com/docs/#/displaying/difference/" rel="nofollow noreferrer">https://momentjs.com/docs/#/displaying/difference/</a>
  But I'm only going to use this for a one-time function.</p>
  <p>Thank you in advance! Much appreciated!</p>