Right now, I am receiving date and time in the format 'mm/dd/yyyy, hh:mm:ss'. Is there a way to retrieve it in this format 'mm-dd-yyyy hh-mm-ss' without relying on any external libraries, and by potentially passing certain arguments to the function itself?
Here is the code snippet that I am currently utilizing (within Angular 5):
console.log(new Date().toLocaleString(undefined, { hour12: false }));