This article was originally posted in my blog.
Formats of string date:
We can pass the
yyyy-mm-dd format string directly in the
new Date() constructor as below example.
let date_string = "2020/04/03/"; // Apr 03 2020 let output = new Date(date_string); console.log(output.toString()); // Fri Apr 03 2020 00:00:00
Next two conversions are,