ES6 - Date() Method


JavaScript Date() method returns today's date and time and does not need any object to be called.

Syntax

Date() 

Return Value

Returns today's date and time.

Example

var dt = Date(); 
console.log("Current Date ",dt); 

Output

Current Date Tue Sep 20 2016 22:24:31 GMT+0530 (India Standard Time) 
Advertisements