var A = Date.now();
Where A is time in millisecond.
Parameters: This function accepts no parameter.
Return Values: It returns the number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC.
The time elapsed in millisecond is: 1529644667834
To get the current date, use the code below.
The current date is: Fri Jun 22 2018 10:54:33 GMT+0530 (India Standard Time)
The Date(Date.now()) is same as Date(), so the same result can be achieved i.e, current date using the following code.
The current date is: Fri Jun 22 2018 11:02:01 GMT+0530 (India Standard Time)
This article is attributed to GeeksforGeeks.org