JavaScript Date() 方法


定义和用法

Date() 方法可返回当天的日期和时间。

语法
  1. Date()

实例

在本例中,我们将输出今天的日期和时间:

  1. <html>
  2. <body>
  3. <script type="text/javascript">
  4. document.write(Date())
  5. </script>
  6. </body>
  7. </html>

分类导航