title: Get Date format as output in the form of y-MM-dd reactjs
body: <p>im trying to get (y-MM-dd) format as output(only the date). Im using react npm datepicker and the code im following is:</p>
  <pre><code>const [dateValue, onDateChange] = useState(new Date());
  
  &lt;DatePicker
                onChange={onDateChange}
                value={dateValue}
                minDate={new Date()}
                format=&quot;y-MM-dd&quot;
              /&gt;
  </code></pre>
  <p>Output of this code is: Thu Oct 28 2021 00:00:00 GMT+0500 (Pakistan Standard Time)</p>