无涯教程-Date()函数

17 阅读1分钟

JavaScript Date()方法返回今天的日期和时间,不需要调用任何对象 。

Date() - 语法

Date() 

Date() - 返回值

返回今天的日期和时间。

Date() - 示例

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

运行上面代码输出

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

参考链接

www.learnfk.com/es6/es6-dat…