title: JavaScript Calendar Operations
body: <p>I have Java code like that:</p>
  
  <pre><code>  //first moment of the today
    Calendar cal = new GregorianCalendar();
    cal.set(Calendar.HOUR_OF_DAY, 0);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
  
    Calendar tomorrow = (Calendar)cal.clone();
    tomorrow.add(Calendar.DAY_OF_YEAR, 1);
  
    long time = d.getTime();
  
    // if greater than today's first moment
    if(time &gt;= tomorrow.getTimeInMillis()){
    ...
    }
    ...
  </code></pre>
  
  <p>How can I rewrite it with JavaScript?</p>