title: How can get only date without time from a string contain date and time?
body: <p>I've a date like that <code>01/03/22 22:09</code> and I want to store it in <code>DB</code> just in a format of date like like that <code>'2022-03-01'</code>; I've tried <em>Regex</em> but still get time in <em>an hour:minute</em> too<br />
  How can I delete it?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const date_time = '22/01/03 22:09';
  const only_date = date_time.replace(/(\d{2})\/(\d{2})\/(\d{2})/,"'20$3-$2-$1'");
  //console.log(only_date.substring(0,only_date.lastIndexOf("'")+1))
  console.log(only_date)</code></pre>
  </div>
  </div>
  </p>
  <p>PS: without using substring or slice... just with regex is there a way to do that?</p>