如何使用 JavaScript 获取当前日期

学习如何使用 JavaScript 获取当前日期。

当前日期

使用 new Date() 获取当前日期:

实例

const d = new Date();

亲自试一试

相关页面

教程:JavaScript 日期