title: Question regarding date function in javascript
body: <p>I'm making a function for recalculating a time based on the current time.
  timeShowToday is a specific time everyday (set at 8:00 pm) to reveal some blinded answer. </p>
  
  <pre><code>_checkTime = () =&gt; {
      let timeNow = new Date();
      let timeShowToday = new Date(   //set at 8:00pm everyday
        timeNow.getFullYear(),
        timeNow.getMonth(),
        timeNow.getDate(),
        20,
        0
      );
  
      let timeShowYesterday = timeShowToday.setDate(timeShowToday.getDate() - 1);
      let timeDiff = timeShowToday.getTime() - timeNow.getTime();
  
      if (timeDiff &lt; 0) {  //recalculate if current Time is past specific time(8:00pm) 
        let temp = new Date(
          timeNow.getFullYear(),
          timeNow.getMonth(),
          timeNow.getDate(),
          20,
          0
        );
        console.log(temp);
        timeShowYesterday = temp;
        timeShowToday = timeShowYesterday.setDate(
          timeShowYesterday.getDate() + 1
        );
        console.log(timeShowYesterday);
      }
  </code></pre>
  
  <p>The problem here is that variable temp and timeShowYesterday has different datetime eventhough I've just assigned temp to timeShowYesterday. This is the log I get when I console log it:</p>
  
  <blockquote>
    <p>05-03 00:26:59.623 ReactNativeJS: temp: Fri May 03 2019 20:00:00 GMT+0900<br>
    05-03 00:26:59.623 ReactNativeJS: timeShowYesterday: Sat May 04 2019 20:00:00 GMT+0900</p>
  </blockquote>
  
  <p>As you can see, temp logs the current time correctly but timeShowYesterday has +1 day. I have no idea why this is the case, because all I did was just assign temp to timeShowYesterday. </p>
  
  <p>am I missing something? 
  Thank you</p>