title: Moment.js formatting date field to a day earlier than it should
body: <p>This is a very small little bug I'm trying to fix in my code. I have a React component with this initial state</p>
  <pre><code>const initialFormData = Object.freeze({
      date: Moment(new Date()).format('YYYY-MM-DD'),
      price_per_gallon: '',
      trip_distance: '',
      gallons: '',
      car: ''
  });
  
  const [formData, updateFormData] = useState(initialFormData);
  </code></pre>
  <p>Which is used in a form like so:</p>
  <pre><code>&lt;MuiPickersUtilsProvider utils={DateFnsUtils}&gt;
      &lt;Grid container justifyContent=&quot;space-around&quot;&gt;
          &lt;KeyboardDatePicker
              fullWidth
              disableToolbar
              inputVariant=&quot;outlined&quot;
              format=&quot;yyyy-MM-dd&quot;
              margin=&quot;normal&quot;
              id=&quot;date-picker-inline&quot;
              label=&quot;Date of Fillup&quot;
              name=&quot;date&quot;
              value={formData.date}
              onChange={handleDateChange}
              KeyboardButtonProps={{
                  'aria-label': 'change date',
          }}
          /&gt;
      &lt;/Grid&gt;
  &lt;/MuiPickersUtilsProvider&gt;
  </code></pre>
  <p>I've done console.logs to see that the Moment(new Date()).format('YYYY-MM-DD') shows today's date, as I want, but for some reason when the component renders it has the default date in the field as yesterday<a href="https://i.stack.imgur.com/8Jy9B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Jy9B.png" alt="enter image description here" /></a>, but if I were to get rid of initializing the date with the Moment instance and just have it be 'new Date()', it renders with today's date correctly.</p>
  <p>Any idea why this could be? Kind of wracking my brain here, I just want the default date on my form to be whatever the current day is, and need to format it to YYYY-MM-DD because that's how my API sends and receives the data</p>
  <p>Edit: Here are three console.logs I've tried:</p>
  <pre><code>console.log(new Date());
  console.log(Moment(new Date()).format('YYYY-MM-DD'));
  console.log(Moment().format('YYYY-MM-DD'));
  </code></pre>
  <p>and their results:</p>
  <pre><code>Wed Feb 09 2022 22:01:41 GMT-0500 (Eastern Standard Time)
  2022-02-09
  2022-02-09
  </code></pre>
  <p>But for some reason the second two using Moment will cause the component to render with yesterday's date</p>