new date() time in which formate code example
Example 1: javascript full date as string
<p>The toDateString() method converts a date to a date string:</p>
<p id="demo"></p>
<script>
var d = new Date();
document.getElementById("demo").innerHTML = d.toDateString();
</script>
//output: Fri Oct 16 2020
Example 2: javascript date format
Modern JavaScript date utility library https://date-fns.org/
date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.