title: How to get date and time in mm-dd-yyy hh-mm-ss in typescript?
body: <p>Currently, I am getting date time in the following format 'mm/dd/yyyy, hh:mm:ss'.
  How to get it in the following format 'mm-dd-yyyy hh-mm-ss'.</p>
  
  <p>How to achieve this without using any library, and preferably by passing some args to the function itself?</p>
  
  <p>Below is the code that am currently using (in Angular 5)
  <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>console.log(new Date().toLocaleString(undefined, { hour12: false }));</code></pre>
  </div>
  </div>
  </p>