title: how to check if the date is in a specific format or not using typescript
body: <p>Is there any way to test the date formats.</p>
  
  <p>I have tried below method</p>
  
  <pre><code>let newdate = new Date(myStringDate);
  Date.parse(myStringDate)
  result = `${newdate.getDate()}/${newdate.getMonth() + 1}/${newdate.getFullYear()}`
  </code></pre>
  
  <p>Here i will get result in dd/MM/yyyy format.
  And now i need to check the format is valid or not. Please look into this and provide me a suitable way to check the format.</p>