Date() 方法可返回当天的日期和时间。
Date()
在本例中,我们将输出今天的日期和时间:
<html><body><script type="text/javascript">document.write(Date())</script></body></html>
<html>
<body>
<script type="text/javascript">
document.write(Date())
</script>
</body>
</html>