title: How to compare two dates in moment JS
body: <p>I have two inputs, one is a date, the second is a time. I need to check if that date and time is in the past or not.</p>
  
  <p>I'm currently residing in Toronto,</p>
  
  <p>My Date input is <code>8/15/2019</code>
  My Time input is <code>12:00</code></p>
  
  <p>The issue I face is that when I grab the current date (right now it's 11:00 am. 8/15/2019) the time I actually get is <code>19:00</code> which makes the entire comparison incorrect. </p>
  
  <p>What I tried</p>
  
  <pre><code>var startDateString = moment("8/15/2019" + " " + 12:00, "MM/DD"YYYY" + " HH:mm", true).format();
  </code></pre>
  
  <p>produces </p>
  
  <pre><code>`2019-08-15T12:00:00+04:00`
  </code></pre>
  
  <p>but current date in a string format is quite different. </p>
  
  <pre><code>var now = moment().format(); 
  </code></pre>
  
  <p>produces </p>
  
  <pre><code>`2019-08-15T19:00:00+04:00`
  </code></pre>
  
  <p>I was thinking it should have created a value of <code>2019-08-15T11:00:00+04:00</code></p>
  
  <p>If I can get some tips or assistance on how to correct compare dates, would be greatly appreciated. Maybe I have to offset current moment()? </p>