title: How to Extract Date from date stringg in JS
body: <p>I want to know how to get a date from date string:</p>
  <p>A string is expected to be formatted as follows:
  YYYY-DD-MM</p>
  <p>September 01, 2021 would be: 2021-01-09</p>
  <p>it should be done using functions in Java Script.</p>
  <p>Any answers??</p>
  <p>And Thank you in advance.</p>
  <p><a href="https://i.stack.imgur.com/evrTu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/evrTu.png" alt="enter image description here" /></a></p>