By default, JavaScript will use the browser's time zone and display a date as a full text string:
Sat Oct 12 2019 11:20:40 GMT+0530 (India Standard Time)
You will learn much more about how to display dates, later in this tutorial.
Date objects are created with the new Date()
constructor.
There are 4 ways to create a new date object:
new Date()
new Date(year, month, day, hours, minutes, seconds, milliseconds)
new Date(milliseconds)
new Date(date string)
new Date()
creates a new date object with the current date and time:
var d = new Date();